<aside>
This section is part of the 5-hour System Design Foundations course by Mukul Raina
Section 7: Load Balancing
In Section 5, we established that horizontal scaling requires distributing traffic across multiple servers. A load balancer is the component that makes this possible. It sits between clients and your server fleet, deciding which server handles each incoming request.
What We’ll Cover:
The Problem:
Without load balancer:
- Client must know the IP address of a specific server
- If that server is down, client gets an error
- If that server is overloaded, client gets slow responses
- No way to add or remove servers without changing client configuration
With load balancer:
- Client knows one address (the load balancer)
- Load balancer picks a healthy, available server
- Servers can be added/removed without clients knowing
- Traffic is distributed evenly across all servers
<aside>
Mukul Raina | youtube.com/@mukulraina | slides.mukulraina.com | LinkedIn
</aside>
Load Balancer Responsibilities
A load balancer performs several functions beyond just distributing traffic.
| Function | Description |
|---|---|
| Traffic distribution | Spread requests across multiple backend servers |
| Health monitoring | Detect unhealthy servers, stop sending traffic to them |
| TLS termination | Decrypt HTTPS at the load balancer, forward HTTP to backends |
| Session persistence | Optionally route same user to same server (sticky sessions) |
| Connection management | Maintain persistent connections to backends, reducing handshake overhead |
| DDoS absorption | Absorb connection floods before they reach application servers |