What is a Load Balancer?
Load balancers, told as a story about the usher in front of the counters.
One counter, one long line.As the town grows, one counter clerk can't keep up.
Add counters, and people still crowd one line.Nobody knows which counter is free.
A load balancer is the queue usher.'This way, please.' It spreads people to free counters — and the town never needs to know how many there are.
One counter closes and nobody notices.The usher never sends anyone to a closed counter. The others cover while it's fixed.
If the usher collapses, everything stops.So there are two ushers. And if each counter keeps its own ledger, nobody remembers what you said — so they share one ledger, or send you back to the same counter.
A load balancer = the usher who sends people to whichever counter is free, skips closed ones, and never lets the town see how many counters there are.
One of the receptionist's (reverse proxy's) jobs. Sorting by the envelope alone is L4; reading the note first is L7. nginx, HAProxy, AWS ALB/NLB.
When grown-ups say it
- Round robin
- One each, in turn. 1, 2, 3, 1, 2, 3… the simplest way to spread.
- Least connections
- To the shortest line. Whichever counter has the fewest people right now.
- Health check
- Knocking on the counter door. No answer, no customers sent.
- Sticky session
- Back to the same counter. The fix when each counter keeps its own ledger.
- Autoscaling
- Opening more counters. Long lines open counters; quiet hours close them.
- L4 · L7
- Envelope only vs. reading the note. L4 sorts by address alone; L7 reads the note first. → the receptionist story
- Single point of failure
- One usher. Collapses, and everything stops — hence two.
- Shared session store
- The ledger all counters share. Whichever counter you reach, it remembers you.