teacher
Sign in

Load Balancing

How a load balancer spreads traffic across servers, the L4 versus L7 choice, common algorithms, health checks and sticky sessions.

25 min4 interactive

What it is

A load balancer (LB) sits in front of several servers and forwards each incoming request to one of them. Clients talk to one address; the LB picks the server.

It gives you:

  • Capacity: many servers share the work.
  • Availability: if one server dies, the LB stops sending traffic to it.
  • Flexibility: add or remove servers without clients noticing.

Real tools: Nginx, HAProxy, Envoy, AWS Elastic Load Balancing (ALB and NLB), Google Cloud Load Balancing.

1 of 8