DEV Community

Vlad Z
Vlad Z

Posted on

Cost and performance are not enemies

Cost optimization and performance are not always at odds

But sometimes they are. And pretending otherwise leads to bad decisions in both directions

The engineer who refuses to rightsize a database because "it might affect performance" without checking the actual utilization is using performance as an excuse to avoid change. At 12 percent average CPU utilization, the smaller instance will perform identically

That's the false tradeoff. And it's common

The real tradeoff is different

Caches cost money. They also dramatically reduce database load and response times. Removing a cache to reduce costs can save $200 a month and increase your database bill by $800 while also making your product slower. That's not optimization. That's just moving the cost and degrading the experience

Multi-AZ database deployments cost twice as much as single-AZ. They also mean automatic failover in under 60 seconds when the primary instance has a hardware failure. The cost of going single-AZ to save money is the cost of a database outage happening at the worst possible time. That's a real tradeoff and it depends on how much that outage costs you

CDNs cost money. They also reduce egress costs from origin and make your product faster for users outside your primary region. Removing the CDN to save money often costs more in egress than it saves in CDN fees. The math matters

Here's how I think about the performance-cost tradeoff

What does this resource actually do for the product?

If it has a clear, measurable contribution to performance or reliability that the product depends on: understand the tradeoff before reducing it. Quantify what you'd lose

If the contribution is theoretical or unmeasured: measure first. Don't protect something valuable. Don't destroy something valuable by assuming it isn't

Performance concerns that can't be measured are usually fears, not facts

Fears are expensive to hold. Get your data. Measure them first

Then make educated decisions based on past information rather than guesswork

Top comments (0)