<aside>

This section is part of the 5-hour System Design Foundations course by Mukul Raina

SLIDE 77: The Need for Load Distribution

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:

  1. What a load balancer does and where it sits
  2. Load balancing algorithms (round robin, least connections, IP hash)
  3. Layer 4 vs Layer 7 load balancing
  4. Health checks and failure detection
  5. Load balancer redundancy
  6. Global server load balancing (GSLB)

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>


SLIDE 78: What a Load Balancer Does

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