System Design
8. Load Balancing and ScalabilityAnimated
Horizontal Scaling
Adding more machines.
The idea
Spread load across many identical servers behind a balancer.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Scale the app tier by adding identical instances.
- step:
- 1/4
- at:
- Load balancer
1/8
The green dot is a request moving through the system.
Step by step
- 1Make servers stateless
- 2Put them behind a balancer
- 3Add machines when load rises
- 4Remove when it falls
Where it is used
Web tiers.
Watch out for
State and databases are harder to scale out.