A service is at capacity. When is vertical scaling the better answer than horizontal, and what is the trap in each direction?
Show the full answer Hide the answer
When vertical is better
- When the workload is stateful and coordination is expensive. A single larger database instance avoids sharding, cross-shard queries, distributed transactions and rebalancing — all of which are permanent complexity. Vertical scaling is often several years of runway for one afternoon of work, and taking it is frequently the correct engineering decision rather than a deferral.
- When the bottleneck is memory or single-threaded performance, neither of which more instances addresses.
- When the team is small. Operating one large instance is dramatically simpler than operating a distributed system, and simplicity has real value that is systematically undercounted.
When horizontal is required
- When you need fault tolerance. One instance is one failure domain regardless of its size, and that alone frequently decides it.
- When the workload is genuinely parallel and stateless.
- When you have exceeded the largest available instance, which is a hard ceiling and the reason vertical scaling is a runway rather than a solution.
- When load varies enormously, since horizontal capacity can be added and removed while vertical cannot without downtime.
The trap in each direction
Vertical: the ceiling arrives suddenly and the migration to horizontal is then done under pressure, which is the worst time. The mitigation is to know where the ceiling is and how much runway remains, and to design the data model with a partition key from the beginning even while running on one instance — because adding a partition key later is one of the genuinely painful migrations.
Horizontal: adopting distributed complexity before it is needed, then discovering that coordination overhead means the system is slower and less reliable than the single instance it replaced. More instances of a coordination-bound workload can reduce throughput, which is counter-intuitive and regularly observed.
The judgement
Scale vertically for as long as it is possible, while making the horizontal move cheap. The cheap-move preparation is the partition key, stateless application tiers and an absence of instance-local state — none of which costs anything on one instance and all of which is expensive to retrofit.
That is the answer that respects both the simplicity of vertical and the inevitability of the ceiling.