Definition
A load balancer is a traffic-control system that spreads incoming work evenly across several servers (computers) when lots of people hit an internet service at once. It keeps one overloaded machine from crashing the whole website.
How a toll plaza opens more lanes
Picture a highway toll plaza with just one booth open. What happens? Think of a holiday weekend: cars pile up for miles and the whole road jams. Now open ten booths, and put an attendant at the entrance who quickly waves each car toward an empty booth. Traffic flows smoothly.
The internet works the same way. On the day concert tickets for a huge pop star go on sale, or when college students sign up for classes, hundreds of thousands of people knock on a website's door at the same moment. If only one computer (server) handles those requests, it can't keep up. It gets overloaded, and your screen freezes on a blank page.
So big services line up many computers that do the exact same job. Then they put a load balancer right in front of them. It sends visitors to the machines that have room, sharing the traffic evenly so no single server gets overwhelmed. It's the key piece that keeps everything running.
What rules does it use to split the work?
A load balancer uses a few smart rules (called algorithms) to decide who goes where. The simplest one goes around in a circle: visitor one to server 1, visitor two to server 2, visitor three to server 3, and then back to the start. This is called "round robin."
But not every visitor asks for the same amount of work. One person reads a short post and leaves in seconds. Another downloads a huge video and ties up a computer for a long time. So another popular method is to find, in real time, the server with the fewest active connections and send the next visitor there.
Also, the servers might not all be equally powerful. You could send three tasks to a brand-new machine and just one to an older one. In this way, the load balancer guides each visitor down the most efficient path, matching the work to each server's spare capacity.
To be more precise: a safety net that skips broken servers
To be more precise, a load balancer doesn't just split up the work. It also runs "health checks," sending a signal to each server every few seconds (or every few dozen seconds) to make sure it's working properly.
What if one of the servers suddenly breaks down? The load balancer notices when a machine fails to respond several times in a row, and it stops sending visitors there. It reroutes everyone to the servers that are still healthy. In this way, it acts as a reliable shield that automatically filters out broken servers.
Thanks to this, even if a few computers crash, most users keep using the service without ever knowing something went wrong. And when traffic explodes and you add new servers behind the load balancer, it automatically starts sending visitors to them too. That makes scaling up a service much easier.
Common misconceptions
Installing a load balancer makes each server's computing speed faster.
It doesn't boost a computer's brainpower. Instead of making one worker superhumanly fast, it puts several workers on the job and shares the work fairly, which cuts the overall waiting time.
Where you meet it
When hundreds of thousands of people log in for class registration or holiday train ticket sales, it helps keep the servers from shutting down completely.
Video services like Netflix and YouTube, used by hundreds of millions of people worldwide, use it to spread out their traffic.
In one sentence
A load balancer splits incoming requests across many servers, like a traffic cop, so a service keeps running steadily without crashing.