<arch.design/>
Principles/Load Balancing
InfrastructureInfrastructureintermediate1992l4l7round-robinnginx

Load Balancing

Distribute incoming traffic across multiple servers to maximise throughput, minimise latency, and prevent overload.

5/5
Operates at: Infrastructure level

Deployment platform — Kubernetes, Docker, cloud config

Interactive visualization

Live
Algorithm:
ClientrequestsLoadBalancerround-robinhealth checks ✓Server 10 active · 0% trafficServer 20 active · 0% trafficServer 30 active · 0% traffic
Server health:

How it works

Load balancers sit between clients and backend servers, distributing requests to ensure no single server is overwhelmed. They operate at different OSI layers:

— Layer 4 (Transport): routes based on IP/TCP — fast, no HTTP awareness (HAProxy, AWS NLB) — Layer 7 (Application): routes based on HTTP headers, URL, cookies — smarter, enables path-based routing (Nginx, AWS ALB)

Distribution algorithms: Round Robin, Least Connections, IP Hash (sticky sessions), Weighted Round Robin, Random.

Health checks poll backends; unhealthy instances are removed until they recover.

Why it matters

Without load balancing, a single server is a single point of failure and scalability ceiling. Load balancers are the fundamental building block for high availability.

When to use

  • Any service running multiple backend replicas
  • High-traffic applications requiring horizontal scaling
  • Zero-downtime deployments using rolling updates

When NOT to use

  • Single-instance development environments
  • When a service mesh already handles load distribution

Trade-offs

+

Horizontal scalability and high availability

Stateful sessions require sticky routing or external session store

+

Health-check-based automatic failover

Load balancer itself becomes a SPOF without redundancy

In production

AWS

ALB handles HTTPS termination and path-based routing for millions of apps

Cloudflare

Anycast routing + load balancing across 300+ PoPs globally

Industry adoption

5/5Ubiquitous — used at virtually every scale-focused company.

Related principles