LearnViz CompSci
Home / Learn / Computer Networks / Load Balancers

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

  1. Clients send requests to a single address.
  2. The balancer picks a healthy server.
  3. It uses round robin, least connections or hashing.
  4. The next request goes to another server.
  5. 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

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Computer Networks quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Load Balancers?
Devices spreading traffic across servers. It belongs to Computer Networks and is an advanced-level topic.
Where do people use Load Balancers?
Websites, APIs, microservice meshes and databases with read replicas use load balancers, such as NGINX, HAProxy and cloud-managed services.
What is the most common mistake with Load Balancers?
The load balancer itself can become a single point of failure unless redundant.
What should I learn before this topic?
Start with CDN, the topic just before it in Computer Networks.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Computer Networks quiz.
Is Load Balancers hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Load Balancers?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Load Balancers?
CDN, Proxies, FTP and SSH are closely connected. The full list is in the related topics section of this page.
What should I study after Load Balancers?
Continue with Proxies, the next topic in Computer Networks.

Related topics