What Is a Load Balancer, and Why Do You Need One?
Picture a popular restaurant with one waiter and fifty tables. Orders pile up, food arrives cold, and eventually people just leave. Now imagine the same restaurant with five waiters and someone at the door quietly deciding which waiter takes each new table. That doorperson is what a load balancer does for a website — except instead of tables, it's routing requests, and instead of waiters, it's servers.
The problem: one server can only do so much
Every server — the computer that actually runs your app and answers requests — has limits. It can handle a certain number of visitors per second before it runs out of CPU, memory, or network capacity. Below that limit, things feel instant. Above it, requests start queuing, response times creep up, and eventually the server stops responding altogether.
The obvious fix is to run more than one server. But that creates a new question: when a visitor's browser wants to load your site, which of those servers should actually handle the request? Someone — or something — has to decide, and it has to decide fast, thousands of times a second, without ever sending two people to a server that's already collapsing under load.
What a load balancer actually does
A load balancer sits between your visitors and your servers. Every request hits the load balancer first, and the load balancer forwards it to one of the servers behind it based on some strategy. The visitor never knows or cares which server actually answered — they just see one website at one address.
A few common strategies for picking a server:
- Round robin — hand out requests to servers in a rotating order, like dealing cards one at a time to each player.
- Least connections — send the next request to whichever server is currently handling the fewest open requests, so work stays roughly even.
- Weighted routing — give a bigger, more powerful server a larger share of the traffic than a smaller one.
None of these need to be fancy to work well. The point isn't finding the mathematically perfect server for every single request — it's spreading load roughly evenly so no single machine gets overwhelmed while others sit idle.
Health checks: the other half of the job
Splitting traffic is only half the story. A load balancer also constantly checks whether each server behind it is actually healthy — usually by pinging a small "health check" endpoint every few seconds. If a server stops responding, crashes, or starts erroring, the load balancer quietly stops sending it traffic and routes everything to the servers that are still working.
This is what makes load balancers so valuable for reliability, not just speed. If you have three servers and one fails at 3 a.m., visitors don't see an outage — they just get routed to one of the other two. The failure is invisible from the outside, as long as the remaining servers can absorb the extra load.
Why this matters even before you're "big"
It's tempting to think load balancers are only for huge companies serving millions of users. In practice, they solve two problems that show up at any scale: they let you add more servers as traffic grows without redesigning anything, and they let you take a server down for maintenance or a deploy without anyone noticing. Even a site with modest traffic benefits from not having a single point of failure.
They also make deployments safer. A common pattern is to update servers one at a time — take one out of the pool, update it, put it back, then move to the next — so the site stays up the entire time a new version is rolling out.
The takeaway
A load balancer is the traffic cop standing in front of your servers: it spreads requests across the machines that can handle them, and it stops sending traffic to any machine that stops responding. That one idea — don't rely on a single server, and don't send work to one that's struggling — is what lets websites stay fast and available as they grow, and it's one of the most quietly essential pieces of infrastructure on the internet.
This explainer was made with LineLapse — type a topic, get a hand-drawn video. Make your own →