Advanced Topic 38 of 50 Computer Networks
Load Balancers
Devices spreading traffic across servers.
How it works
A load balancer distributes incoming requests or connections across a pool of servers to improve capacity, availability and latency. Layer 4 balancers route by IP and port, and layer 7 balancers inspect HTTP to route by host, path or cookie. Algorithms include round robin, least connections, weighted and consistent hashing. Health checks remove failed servers automatically, and session persistence can pin a client to one backend.
Step-by-step walkthrough
- Clients send requests to a single address.
- The balancer picks a healthy server.
- It uses round robin, least connections or hashing.
- The next request goes to another server.
- If a server fails, health checks remove it and traffic continues.
Where it is used
Websites, APIs, microservice meshes and databases with read replicas use load balancers, such as NGINX, HAProxy and cloud-managed services. They enable rolling deployments and horizontal scaling.
Common pitfall
The load balancer itself can become a single point of failure unless redundant. Sticky sessions cause uneven load and complicate scaling, so prefer stateless servers. Wrong health checks mark healthy servers down or send traffic to broken ones. Connection draining avoids dropping requests during deploys.
Where it fits in the course
Load Balancers is topic 38 of 50 in Computer Networks, rated Advanced. It follows CDN. The next topic is Proxies.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Computer Networks quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Load Balancers?
Where do people use Load Balancers?
What is the most common mistake with Load Balancers?
What should I learn before this topic?
How can I practice it?
Is Load Balancers hard to learn?
How long does it take to learn Load Balancers?
Which topics are related to Load Balancers?
What should I study after Load Balancers?
Related topics
- CDN (Computer Networks)
- Proxies (Computer Networks)
- FTP and SSH (Computer Networks)
- Firewalls (Computer Networks)
- Load Balancing Algorithms (Distributed Systems & Cloud)
- Load Balancing in Parallel Programs (Concurrency & Parallelism)