Load Balancers

12 min read

One server can only handle so many requests. A load balancer stands in front of many servers and sends each request to a server that can take it. In this lesson you learn how it chooses, and what happens when a server dies.

New words

Load balancer
A machine that shares incoming requests between many servers.
Round robin
Send requests to servers one by one, in a fixed order.
Least connections
Send the next request to the server with the fewest running requests.
Health check
A small test the balancer runs to see if a server is alive.
Sticky session
A rule that keeps sending one user to the same server.
Single point of failure
One part that, if it breaks, stops the whole system.

What you will learn

  1. The problem, and what a load balancer does
  2. How does it choose a server?
  3. Health checks: do not send people to a closed counter
  4. Sticky sessions, and a backup for the balancer
  5. Try it: send requests to 4 servers
  6. Trade-offs
  7. In a real system
  8. Interview tip
  9. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap