Load Balancing

Dilmi Palliyaguruge
3 min readMar 5, 2021

How can someone scale, optimize and secure the app while keeping the users happy? Solution for this is cloud load balancing.

What is Load Balancing?

Load balancing is a fully distributed and software defined solution that balance the user’s traffic to multiple backends to avoid congestion and ensure low latency. A load balancer takes loads which are requests from users using your service and it routes the traffic to different backend servers.

There are different types of load balancers depending on the type of traffic you are dealing with.

  1. Application load balancer
  2. Network load balancer
  3. Classic load balancer

Application load balancers are used to route HTTP/HTTPS traffic while Network load balancers and Classic load balancers are used to route TCP traffic. The application load balancer functions at the application layer(or the 7th layer), Network load balancer functions at transport layer and Classic load balancer makes routing decisions either in transport layer or application layer. There are several load balancing methods which rely on different algorithms.

  1. Round Robin
  2. IP Hash
  3. Least Connections
  4. Least Response Time
  5. Least Bandwidth

Among above algorithms, Round Robin is the most widely used load balancing algorithm. It is more suitable for clusters consisting of servers with identical specs and it is easy to implement as well. The Least Connection will try to determine which server has the least number of connections and then assign the new connection to the server. In IP Hash, the IP address of the client determines which server receives the request. The Least Response Time algorithm directs traffic to the server with the fewest active connections and the lowest average response time.

Why cloud load balancing is important?

Cloud load balancing is important when improving the system performance and to protect against system failures. If one server suddenly goes down then the load balancer can redirect traffic to another server. Scalability is also another major advantage of load balancing. It will increase network performance and provide fault tolerance as well.

Popular load balancers

Cloud providers like Amazon Web Services (AWS), Microsoft Azure and Google offer cloud load balancing to facilitate easy distribution of workloads. As examples AWS offers Elastic Load balancing (ELB) technology to distribute traffic among EC2 instances. If you are using Google cloud load balancer, you will come across with several types like Internal and External load balancer and Global and Regional load balancer. When the backends are distributed among several regions Global load balancing can be used and if the backends are in the same region Regional load balancing can be used.

So, here is a brief introduction about load balancing and hope you learnt something. Thank you!

--

--