Horizontal vs Vertical Scaling
Horizontal and vertical scaling are both ways to handle more work, but they grow in two different ways. Vertical scaling makes one machine bigger, with more cores and memory. Horizontal scaling adds more machines that share the load. Going up is easy but has a ceiling. Going out has no ceiling, but the app must be built for it.
Horizontal Scaling
Handling more work by adding more machines that share the load.
Horizontal scaling means handling more work by adding more machines. Each machine runs a copy of the app, and a load balancer spreads the requests among them. There is no hard upper limit: you keep adding machines. If one machine dies, the others carry on. The app must be built for it, though, with no user data kept on a single machine.
Vertical Scaling
Make one machine bigger to handle more work.
Vertical scaling means handling more work by giving one machine more power. You add CPU cores, memory or faster disks to the server you already have. The app does not need to change at all, which makes it the easiest first step. But every machine has a top size, and bigger machines cost a lot more. If that one machine fails, everything stops.
In one line
- Horizontal Scaling
- Handling more work by adding more machines that share the load.
- Vertical Scaling
- Make one machine bigger to handle more work.