Infrastructure / DevOps

Load Balancing

Load balancing explained: how a load balancer spreads requests across servers, uses health checks to skip failed ones, and picks a server for each request.

  • 8 min read
  • 5 questions
  • +35 XP
Transcript

Load balancer explained by cats. Kitty runs a website. She sells tuna. At first, there are only two users. One tiny server, no problem. Then those two users love it and tell everyone. Now every cat in town wants tuna.

One server can't keep up. It's melting, so Kitty adds more servers, five of them. But now there's a new problem. How do users know which server to visit? Some servers are full, some are sleeping, some might even crash.

Kitty needs a load balancer. A clever cat who stands at the door. Every time a request comes in, load balancer cat checks all servers. Who's healthy? Who's least busy? Then sends the user to the right one. If a server goes down, no worries.

Load balancer skips it automatically. Everyone still gets their tuna, fast and fresh. That's load balancing. Sharing the load, keeping every kitty happy.