Vertical scaling, or scaling up, means giving one machine more CPU, memory, disk or network so it can take more load. Horizontal scaling, or scaling out, means adding more machines and spreading the load across them with a load balancer, partitioning or replication. Vertical scaling is simple because the software does not change, but it has a hard ceiling at the largest machine you can buy, gets expensive near that ceiling, and leaves one machine as a single point of failure. Horizontal scaling has a much higher ceiling and survives the loss of a machine, but it needs stateless services or partitioned data, and it brings network hops, coordination and consistency questions with it. In practice you scale stateless tiers out from the start and scale databases up until you have a reason not to.
Your server is running hot. There are two ways out. Make the machine bigger, or add more machines. Scaling up is the simple one. Give the same box more CPU, more memory and faster disks, and the software doesn't change at all. But there's a ceiling: the largest instance you can buy. The price climbs steeply near the top, and it's still one machine. If it fails, everything fails with it. Scaling out adds machines instead. A load balancer spreads requests across identical servers, and when one dies, you only lose a little capacity. Traffic spikes in the evening? Autoscaling adds servers, then removes them when it's quiet. The catch: the servers must be stateless, or the data has to be partitioned. And scaling out moves the bottleneck. Ten times the app servers still share one database, and now that's what saturates. So the usual order is: scale stateless tiers out from day one, scale the database up, add read replicas and a cache, and shard only when writes outgrow one primary.
| Aspect | Horizontal scaling | Vertical scaling |
|---|---|---|
| How | Add machines and spread the load | Move to a bigger machine |
| Ceiling | Much higher; limited by coordination and shared bottlenecks | The largest instance available |
| Software changes | Needs stateless tiers, a load balancer, partitioned data | Usually none |
| Failure behavior | Losing a node reduces capacity | The machine is a single point of failure unless replicated |
| Resizing | Add or remove nodes live, often automatically | Often needs a restart or a failover |
| Consistency | Replication lag and cross-node coordination to manage | One node, so simple |
| Good fit | Web and API tiers, caches, sharded stores, stream processors | A relational primary early on, in-memory workloads, small systems |
Scale out when
The service is stateless or can be made stateless.
Scale up when
The component is hard to split, such as a relational primary with many joins.
A common sequence for a growing relational database is: tune queries and indexes, scale the primary up, add read replicas for read traffic, put a cache in front of hot reads, and only then shard. Each step is cheaper to undo than the next. Read replicas are themselves horizontal scaling, but only for reads; every write still goes to one primary.
The application tier usually skips all of that and scales out from day one, because stateless servers behind a load balancer are cheap to add and remove.
Adding app servers only helps until something shared saturates: the database, a cache shard, a lock, or a downstream API with its own rate limit. When you scale a tier out in an interview, name the next bottleneck before the interviewer does. That is usually the most valuable minute of the capacity discussion.
This shows up during estimation. Work out whether the data and the traffic fit on one machine, then decide what has to scale out. Interviewers reward numbers here: storage per day, requests per second at peak, and what a single node can reasonably serve.
“The API tier is stateless, so we scale it horizontally behind the load balancer and autoscale on CPU. The database holds about a terabyte after five years, which fits on one large primary, so I would scale it vertically and add read replicas for the read-heavy traffic, and only shard if write volume outgrows the primary.”
Neither in general. Vertical is simpler and right until you hit its ceiling or need fault tolerance. Horizontal is required at large scale and for high availability, and it costs more design work.
Yes, for reads. Replicas spread read traffic across machines, but all writes still go through one primary, so write capacity does not grow.
Automatically adding or removing instances, usually based on CPU, request rate or queue depth. It is horizontal scaling run by a controller instead of a person.
Combining both: scale each node up to a cost-effective size, then scale out by adding more of those nodes.
The piece that makes scaling out work.
Read replicas, leaders and what replication lag costs.
Scaling writes out once one primary is not enough.
Taking read load off the tier that is hardest to scale.
Scaling groups, policies and warm-up in the cloud.
Estimation first, then decide what actually needs to scale.
Shared counters across a horizontally scaled tier.
The component at the center of scaling out.
Scaling transcoding workers and delivery separately.
Knowing the trade-off is half of it
Practise saying it under follow-up questions: a timed system design interview with an AI interviewer that probes your choices and grades against a rubric.