Load Balancing
1 min read
Spread traffic across workers so no single instance becomes the bottleneck.
Load balancing spreads traffic across many workers so one instance does not become the bottleneck or failure point.
How It Works
Load balancers distribute incoming requests across a pool of servers. Layer 4 (TCP) balancers route based on IP/port — fast but blind to request content. Layer 7 (HTTP) balancers can route based on URL path, headers, or cookies. Algorithms: round-robin, least-connections, consistent hashing. Health checks remove unhealthy instances. In interviews, mention the load balancer early in your HLD and name the algorithm.
Real-World Example
Netflix uses a two-tier load balancing approach: AWS ELB at the edge distributes traffic across availability zones, then an internal Zuul gateway (Layer 7) routes requests to specific microservice instances based on path and performs canary routing for deployments.
Test Yourself
What problem does load balancing solve before the database is even involved?
Get notified when we launch
One email when the full practice product is live. No spam.