Horizontal Scaling (Scale Out)
Add more commodity machines behind a load balancer so traffic and failures are shared.
In plain words
Instead of buying one super-expensive mega-computer, you run 20 normal computers side by side and put a traffic cop (load balancer) in front to split the work.
Think of it like…
Opening 10 normal checkout lanes at a supermarket instead of training 1 superhuman cashier.
Theory & how it works
Why cloud systems love horizontal scaling
Adding more identical machines gives you near-linear capacity growth using cheap commodity servers. If one node crashes, the load balancer stops sending traffic to it and the remaining 99% stay online.
You can also do zero-downtime rolling deployments: upgrade half the fleet while the other half keeps serving users.
The hidden costs of scaling out
Scaling out introduces network hops and distributed state. A load balancer must sit in front, servers must be stateless, and background jobs (like scheduled cron tasks) must not run 20 times in parallel without coordination.
If your database isn’t scaled too, 200 web servers opening 50 connections each = 10,000 connections, which will immediately crash PostgreSQL unless you use a connection pooler like PgBouncer.
Key points & practical guide
Summary checklist
- Near-unlimited capacity by adding commodity nodes
- Built-in fault tolerance: losing 1 of 10 nodes leaves 90% capacity intact
- Requires stateless app servers and careful DB connection pooling
When to use it
- Stateless web APIs and microservices
- Any system requiring high availability (99.9%+) and zero-downtime deploys
Watch out for
- Opening too many DB connections when scaling out app servers
- Running duplicate cron jobs across every node without a distributed lock