← System Design learning path
System Design · Module 3 of 10

Load balancing

Distribute traffic across servers.

📖 Key ideas

  1. Load balancers spread requests across servers.
  2. Algorithms: round robin, least connections, IP hash.
  3. Health checks remove unhealthy servers.
  4. Layer 4 (TCP) vs layer 7 (HTTP) load balancers.
  5. Examples: Nginx, HAProxy, AWS ALB, Google Cloud LB.
💡 Real-life example: A load balancer is a toll plaza manager sending cars to the shortest queue.
Load balancerDistributes traffic
Round robinRequests in rotation
Health checkChecks server health
Layer 7 LBRoutes by HTTP content