Load balancing

Load balancing

What is load balancing ? 

   As the name suggest this technique is used in distributing the load. 

Why it is used ? 

   In any high available scalable application it will be deployed in multiple servers and load balancing techniques are used for providing failover support. 

Where it is used ? 

   Load balancing sits in front of multiple servers and uses routing algorithms like round robin for distributing the load. 

How it is used ? 

  Load balancing can be used in the following kinds  

  1. Hardware 
  2. Software 

Examples 

  1. Between front end clients and backend servers. 
  2. Between webservers and applications. 
  3. Between application servers and database servers. 
  4. Between application servers and cache layers. 

Types of load balancers. 

  1. Smart clients 

As the name suggest, load balancing techniques are used in client itself and also it will check for health and status of the backend servers. 

It is good for small solutions. 

Example 

Clients can be mobile or application that can pick and route to any servers by detecting its health and status. 

Problems 

    1. It will be very hard for scaling large scale applications. 

    2. It will be very hard to maintain.  

2. Hardware

As the name suggest, hardware is used 

Advantages 

   Extremely scalable and available. 

  Problems 

   1. It is costly. 

   2. Hard to configure. 

  Example : Citrix Netscaler 

3. Software

   As the name suggest, software is used. 

Advantages 

   1. Pre built only configuration required 

   2. It can be installed on both linux and windows servers 

   3. Cost effective. 

   4. Provides some addon functionalities like HTTP caching. 

  Example : Haproxy 

Load balancing techniques are used for handling the following kinds of traffics 

  1. HTTP – Typical web server traffic. 
  2. HTTPS – Similar to HTTP in addition with encryption.  
  3. UDP – core internet protocols 
  4. TCP – Request to database 

 

How does the load balancing route the requests ? 

  1. It uses different strategies for routing such as 

1. Round Robbing 

   2. Weighted Distribution 

   3. Sticky session 

2.  Load balancing also health checks the backend servers and transfers the request to the active backend server for providing high availability and to avoid data loss. 

Strategies in detail 

  1. Round Robbing 

In this load balancer will transfer request to the active backend servers equally across active servers without considering the hardware capability. 

No alt text provided for this image

2. Weighted Distribution 

In this load balancing will transfer request to the active backend servers based on hardware capability 

No alt text provided for this image

3. Sticky session 

   In this load balancing will transfer request to the active backend servers based on sticky session 

No alt text provided for this image

Images are drawn using draw.io and open sourced in github 

     Github - https://github.com/divagartech/system-design/tree/master/Load%20balancing 

Koodalingam P

Developer | Mentor | Lead at Zoho Corporation

5 年

Divagar carlmarx include routing based on url and cookies routing as well

回复

要查看或添加评论,请登录

Divagar Carlmarx的更多文章

  • Processing large amount of CSV data using JAVA

    Processing large amount of CSV data using JAVA

    Have you worked with large amount of csv DATA in GBs ?? And you have memory constraints ?? This might help for you…

    1 条评论
  • Fell in love with Scala

    Fell in love with Scala

    I was a hard core JAVA developer in both my professional and learning journey, but recently for a reason i have started…

  • Scala - Sealed Class Hierarchies

    Scala - Sealed Class Hierarchies

    In my previous article i had shared you regarding Option feature in Scala, in this article come lets discuss about…

  • Scala - NULL handling with MAP

    Scala - NULL handling with MAP

    Sharing three useful types that express a very useful concept i learned today, for NULL handling. Most languages have a…

  • WHY and HOW I started using IntelliJ IDE and SCALA

    WHY and HOW I started using IntelliJ IDE and SCALA

    I was using Eclipse IDE for java enterprise development from beginning of my career and learning journey. In my life…

  • Product based company team management strategies for productivity

    Product based company team management strategies for productivity

    I am sharing my knowledge i got in my professional and personal life as software developer for team management. Lets…

  • Big Data Volume

    Big Data Volume

    Big Data Volume Data volume is characterized by the amount of data that is generated continuously. Different data types…

    2 条评论
  • Distributed Systems - Multi Leader Replication

    Distributed Systems - Multi Leader Replication

    We know in Leader follower model, client can able to write only by leader this if leader is down for any reason, you…

  • Distributed Systems - Replication

    Distributed Systems - Replication

    Replication means keeping a copy of the same data on multiple machines that are connected via a network. Reasons for…

  • Transaction Processing or Analytics ?

    Transaction Processing or Analytics ?

    Transaction processing systems In the early days of business data processing, a write to the database typically…

社区洞察

其他会员也浏览了