In this topic we shall learn about load balancing.
A load balancer is a server that takes the incoming traffic and distributes across multiple servers.
Why do we need Load Balancing?
Let us assume we have an online shopping website. It receives around 1 Million visitors per day. To serve those many customers, the website should be having multiple servers running at the same time.
Once we add more servers, how do we make sure that all the servers are getting equal load? and not only one server is service all the traffic?
Hence we introduce a concept called load balancer.
In this concept, we register the multiple servers to the load balancer and we expose the load balancer to the customers.
Based on the algorithm, the load balancer will distribute the traffic amount the available servers. One of the simplest algorithm is Round Robin.
How the load balancer works?
We assign a virtual IP to the load balancer, and the actual servers are connected to the load balancer. We expose the virtual load balancer IP to the customers.
Features of Load Balancer:
1. It can know how many servers are online.
2. It can guard against DDoS attacks, as it will sacrifice itself without harming the critical servers.
3. Minimizing Downtime. If any one of the critical server is down, then immediately we can shift the traffic to other servers without effecting the traffic.
4. It will become easy to scalability.
5. Customisation will be easy.