Load Balancing Algorithms
We need a load-balancing algorithm to decide which request should be redirected to which backend server. The different system uses different ways to select the servers from the load balancer. Companies use varieties of load-balancing algorithm techniques depending on the configuration. Load balancing algorithms can be broadly categorized into two types: Dynamic load balancing and Static load balancing.
Static load balancing involves predetermined assignment of tasks or resources without considering real-time variations in the system. This approach relies on a fixed allocation of workloads to servers or resources, and it doesn’t adapt to changes during runtime.
Types of Static Load Balancing Algorithms
- Round Robin
- Weighted Round-Robin
- Source IP hash
Dynamic load balancing involves making real-time decisions about how to distribute incoming network traffic or computational workload across multiple servers or resources. This approach adapts to the changing conditions of the system, such as variations in server load, network traffic, or resource availability.
Types of Dynamic Load Balancing Algorithms
- Least Connection Method
- Least Response Time Method
The choice between dynamic and static load balancing depends on the characteristics of the system, the nature of the workload, and the desired level of adaptability. Dynamic load balancing is often favored in dynamic, high-traffic environments, while static load balancing may be suitable for more predictable scenarios.
What is Load Balancer & How Load Balancing works?
Load Balancer is defined as a networking device or software application that distributes and balances the incoming traffic among the servers to provide high availability, efficient utilization of servers, and high performance. A load balancer works as a “traffic cop” sitting in front of your server and routing client requests across all servers. It simply distributes the set of requested operations (database write requests, cache queries) effectively across multiple servers and ensures that no single server bears too many requests.
Important Topics for Load Balancer
- What is a Load Balancer?
- What will happen if there is NO Load Balancer?
- Key characteristics of Load Balancers:
- How Load Balancer Works?
- Types of Load Balancers
- Load Balancing Algorithms
- Benefits of using a Load Balancer
- Cons/Drawbacks of Load Balancers:
- Conclusion