Published

Author

March 14th, 2023

Priyatham Vinnakota

Introduction

Imagine you run a small e-commerce website that sells t-shirts. You have setup a single web server to handle all the requests to your website. Your server is capable of handling 100 requests at a time. One day, your website becomes popular and you start getting more than 100 visitors at a time. This will slow down your website and some users might even face timeout errors.

To solve this problem, you could add a Load balancer to your infrastructure. In this case, you could also setup 2 additional servers each capable of handling 100 visitors at once. A Load balancer’s job is to distribute the traffic evenly among the 3 servers, so that no server becomes overloaded.

As your website continues to grow, you can add more servers and configure your load balancer to distribute traffic across them. This allows you to virtually handle unlimited traffic, while keeping your server performance optimal.

Untitled

Benefits of Load balancers

  1. Load distribution: Load balancers distribute the incoming traffic across multiple servers, ensuring that no server is overloaded and each server is fully utilised.
  2. High availability: Load balancers support failover by diverting traffic to available servers in the event of a server failure.
  3. Scalability: Load balancers makes it easy to increase or decrease the number of servers to the pool of available servers.
  4. Health checking: Load balancers monitor the health of servers and redistribute the traffic to available servers.
  5. TLS Termination: Load balancers can offload TLS termination from web servers, reducing work load on them and improving overall performance.
  6. Security: Load balancers can protect against common web application attacks like DDos attacks, by restricting traffic from suspicious sources.

<aside> 📎 Transport Layer Security (TLS) is a protocol that provides a secure communication between the 2 devices over the network. TLS Termination is a process of decrypting incoming traffic at the server side, so that the server can process the data in plain text.

</aside>

Can Load balancers be a single point of failure?

Yes, Load balancers can indeed be a single point of failure. We can mitigate this risk by a couple of ways:

  1. Redundant load balancer: This involves having multiple load balancers running simultaneously and sharing the load. When one load balancer fails, the other can take over.
  2. Active-standby configuration: This involves configuring 2 load balancers where one Load balancer is actively serving the traffic, while the other one is on standby. This standby takes over if the active Load balancer fails.