Load Balancers — 2

Sanghamitra Hota
2 min readMar 13, 2024

--

Static Load Balancing Algorithms :

1. Round Robin : It is a basic and easy algorithm which sends the request to the server in a sequential manner. If there are 3 servers A,B,C. 1st request goes to server A, 2nd to server B … 4th will again start from server A. The services are usually required to be stateless.

Cons :
This assumes all the server are equi-powered, and might cause a server to overload and crash while other servers are in idle state

2. Weighted Round Robin : This is similar to round robin but every server has some weights attached to it which is directly proportional to the capacity of server. More the weightage, more no. of request the server can handle. It also allocate the request in a cyclic manner.

For eg : If there are 3 servers A,B,C with weights 5,2,1 respectively. Now we have 8 requests. The first 5 request will go to server A, then 2 requests will go to server B and 1 request to server C.
In case there is some incoming requests after these, again it goes to server A until the quota of 5 request is completed, then the request goes to server B .. so on and forth.

3. Sticky Round Robin : This is an improvement of round robin. It combines the principles of Round-Robin and Sticky Sessions. If user A’s first request has been served by server A then all the subsequent request is served by server A. This can be more efficient as unique session-related data does not need to be migrated from server to server. But it doesn't keep in mind the computational power of each server.

It is used in stateful server where we take advantage of the cached information, instead of performing the same costly operation every time the same request is made by the client.

As I wanted to explain hashing properly, I would try to put that in another page :) Bye guys

Next part : https://medium.com/me/stats/post/837bf8484970

--

--

Sanghamitra Hota

Software engineer @servicenow . On a journey to learn new stuffs and write about it :D