Introduction to Load Balancing (Part 1)

Hemant Pandey
4 min readMay 8, 2020

--

You might have heard the term “load balancing” a lot in your software engineering career or your academic classes. This blog discusses the same on a high level and is written primarily for students who are stepping up in the field of software engineering or distributed computing.

Load balancers are one of the most critical components of any distributed system we see today. Load balancing is the process of distributing loads across a cluster of servers or a group of servers to make sure that no individual server is overloaded or underloaded (in some cases). By distributing the load evenly across all servers, load balancers improve the availability, reliability and maintainability of the system. Today, most of the complex systems handle an enormous amount of data every second and thus load balancers have become a necessity.

Apart from distributing load uniformly, modern load balancers also keep track of the status of all the components when distributing the load. For example, if a server is down or stops processing requests, the load balancer will send its requests to another server and thus helps in maintaining the availability of the system. Load balancers perform a continuous health check on all servers to make sure they can receive and process requests in a timely manner. If unhealthy servers are found, the load balancer removes them from the pool of servers until they are restored. Some load balancers even have the capability to create virtualized application servers to meet the demands of the system.

How a load balancer is used?

Usually, a load balancer is present between a client and a server and accepts incoming requests from the clients and distribute the requests evenly across multiple servers. The requests can be in the form of network or application traffic. This uniform distribution of load helps to avoid the single point of failure in the system. Think of a situation where most of your data lie in a single server and it stops working, sounds scary, right?

Want to read this story later? Save it in Journal.

Source: booleanworld.com

The usage of load balancers is not limited between clients and servers. Load balancers can be used between every layer of the system to distribute load uniformly.

Source: educative.io

In the above picture, a load balancer is there between the client and the server to distribute network traffic. Another load balancer exists between the web server and application server to distribute application traffic and then a load balancer is used between the application layer and the database layer to handle database servers.

Benefits of Load Balancing

  • Less Response time: The system does not have to be stuck waiting for a response from an unhealthy server.
  • Improved availability and higher throughput: Even in case of server failure, the load balancer will redirect the load and make sure the system is up.
  • Troubleshoot incoming traffic: Load balancers allow the capability to do predictive analytics on incoming traffic and detect traffic bottlenecks.
  • Avoid single point of failure: Prevents the system from going down due to failure of one component i.e avoids dependency on a single component.

There is a lot to learn about load balancers and how they work. In the next blog, I’ll write more about some popular algorithms on which load balancers work and how load balancers are moving from a hardware-defined component to more of a software-defined component. Stay tuned and Happy learning.

References

📝 Save this story in Journal.

👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. Read the Noteworthy in Tech newsletter.

--

--