System Design
8. Load Balancing and ScalabilityAnimated
Introduction to Load Balancing
Spreading requests across servers.
The idea
A load balancer sits in front of servers and sends each request to a healthy one, improving capacity and availability.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- chosen path
- active connections (bar)
Request 1 goes to server 2: next server in the rotation.
- request:
- 1
- server:
- 2
1/14
The white bar inside each server is its current number of active connections.
Step by step
- 1Client sends a request
- 2The balancer picks a server
- 3The server responds
- 4The balancer forwards the reply
Where it is used
Any service with more than one server.
Watch out for
The balancer itself must not become a SPOF.