Load Balancing Algorithms - Static Load Balancing


There are two broad categories of load balancing algorithms:
Static algorithms: They don’t depend on external feedback to distribute the load .
Dynamic algorithms: opposite of static , depends on external feedback for distribution of load.
Static Algorithms:
1) Round Robin:
Evenly distributes traffic among servers in a cyclical and rotating fashion.
Its Stateless meaning it's not reliant upon any previous states, IPs or external dependencies.
It's not intended to be efficient when scaling up a subset of your server pool. Scaling out, however, is not a problem and usually doesn't require major changes to the load balancer configuration.
Cannot make decisions based on session information i.e doesn’t support session affinity and persistence.
Useful for CDNs, API Gateway , database read replica’s and DNS servers.
2) Weighted Round Robin:
Allows you to assign a weight to each server. That means servers with higher weights receive more requests than those with lower weights.
doesn't take into account any external factors, such as server conditions, connection count or resource utilization. This means that the weights assigned to each server must be manually configured and don't change automatically if you scale up one of the servers in the pool, which adds a layer of manual upkeep.
Can't support session affinity and persistence.
Use case: distribute the load for a CDN among edge servers with different capacities and read requests among database replicas of different capacities.
3) IP Hash:
The IP hash load balancing algorithm allows you to use the hashed value of client IP address to decide which server fulfills the request, thus uniformly mapping client sessions to servers .
Provide session affinity and persistence.
Has some fault tolerance and recovery features as it allows the load balancer to continue serving requests from other servers in case of a failure of the server that was handling the client's request from a particular IP address.
Struggles in highly dynamic cloud environments that frequently scale in and out based on demand, as this induces significant overhead in the load distribution process.
Client requests can be highly inconsistent; some clients might send hundreds of requests while others only send a few. This disparity of traffic from different clients can undermine the effectiveness of the algorithm.
UseCase: social media platforms, banking platforms, e-commerce websites or real-time communication applications.
Subscribe to my newsletter
Read articles from Gaurav directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
