What is Load Balancing and why do we need it?

Aayush Pagare
2 min readJan 7, 2024

--

In simple terms, load balancing is distributing load between servers, but wait why do we need multiple servers? Till now we have just studied that there is a single client and single server.

Centralized system and single point of failure.

This is what we call as Centralized System, here we have no need for load balancing as we have only one server. But as well all know that this one server is SPOF (single point of failure) if this server is down then whole system or application will stop working. That’s one of the reasons why we engineers moved to a Distributed System.

request routing by load balancers

In a distributed system, there are multiple running servers, so we need some mechanism to decide on which server a request should be sent, and we also need to ensure that no server is overflooded with requests and other server is idle. Now Load balancers come into picture.

A load balancer has a routing algorithm, there are various algorithms which it can use. These are two popular algorithms which we can look in next blog.

  1. IP Hashing
  2. Round robin algorithm

By using these routing algorithms, we can route the requests to appropriate servers.

KEY POINTs

  1. Load balancing is used in a Distributed System.
  2. Ensures efficient use of computing resources by evenly distributing requests and preventing individual servers from being overworked.
  3. Enables intelligent routing of requests based on factors such as server health, response times, or geographic location.

Topics covered in next blog.

  1. IP Hashing algorithm
  2. Nginx as a load balancer

--

--

Aayush Pagare

I am on a journey to understand what makes a great software