Types of Load Balancers
There are mainly four typers of load balancers:
1. Software Load Balancers in Clients
As the name suggests all the logic of load balancing resides on the client application (Eg. A mobile phone app). The client application will be provided with a list of web servers/application servers to interact with.
- The application chooses the first one in the list and requests data from the server.
- If any failure occurs persistently (after a configurable number of retries) and the server becomes unavailable, it discards that server and chooses the other one from the list to continue the process.
- This is one of the cheapest ways to implement load balancing.
2. Software Load Balancers in Services
These load balancers are the pieces of software that receive a set of requests and redirect these requests according to a set of rules. This load balancer provides much more flexibility because it can be installed on any standard device (Ex: Windows or Linux machine).
- It is also less expensive because there is no need to purchase or maintain the physical device, unlike hardware load balancers.
- You can have the option to use the off-the-shelf software load balancer or you can write your custom software (Ex: load balances Active Directory Queries of Microsoft Office365) for load balancing.
3. Hardware Load Balancers
As the name suggests we use a physical appliance to distribute the traffic across the cluster of network servers. These load balancers are also known as Layer 4-7 Routers and these are capable of handling all kinds of HTTP, HTTPS, TCP, and UDP traffic. HLDs provide a virtual server address to the outside world.
- When a request comes from a client application, it forwards the connection to the most appropriate real server doing bi-directional network address translation (NAT).
- HLDs can handle a large volume of traffic but it comes with a hefty price tag and it also has limited flexibility.
- HLDs keep doing the health checks on each server and ensure that each server is responding properly.
- If any of the servers don’t produce the desired response, it immediately stops sending the traffic to the servers.
- These load balancers are expensive to acquire and configure, which is the reason a lot of service providers use them only as the first entry point for user requests. Later the internal software load balancers are used to redirect the data behind the infrastructure wall.
Software vs. Hardware Load Balancers: Which one to choose?
The choice between software and hardware load balancers depends on various factors such as the scale of your application, budget constraints, and specific performance requirements. Small to medium-sized enterprises might find software load balancers more cost-effective and flexible, while larger enterprises with high traffic loads might opt for the dedicated power of hardware load balancers.
4. Virtual Load Balancers
A virtual load balancer is a type of load balancing solution implemented as a virtual machine (VM) or software instance within a virtualized environment ,such as data centers utilizing virtualization technologies like VMware, Hyper-V, or KVM.. It plays a crucial role in distributing incoming network traffic across multiple servers or resources to ensure efficient utilization of resources, improve response times, and prevent server overload.
Important read: What are Layer-4(L4), Layer-7(L7), and GSLB load balancers?
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