Skip to content
StackDecode
System Design
8. Load Balancing and ScalabilityAnimated

Introduction to Load Balancing

Spreading requests across servers.

The idea

A load balancer sits in front of servers and sends each request to a healthy one, improving capacity and availability.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

10.0.0.4Load balancerServer 10 totalServer 21 totalServer 30 total
  • chosen path
  • active connections (bar)

Request 1 goes to server 2: next server in the rotation.

request:
1
server:
2
1/14

The white bar inside each server is its current number of active connections.

Step by step

  1. 1Client sends a request
  2. 2The balancer picks a server
  3. 3The server responds
  4. 4The balancer forwards the reply

Where it is used

Any service with more than one server.

Watch out for

The balancer itself must not become a SPOF.

Related