When you win a football match, who gets the credit? The entire team, even if there was a star player of the day. In the match, one person doesn’t take control of the ball. The ball is passed on to whoever can take it nearer to the goal. Servers behave like members of a team when they are grouped together. A server takes up the load (of work) when another server can’t. Unlike a football match, however, multiple servers can work on the ball (the task) at the same time to send it to the goal.
What I just told you in terms of servers is the concept of load balancing. As the term suggests, the concept is about balancing the load of services among multiple servers. Thus, multiple servers act as one unit to accomplish a task.
Who decides how to balance this load? It is the load balancer (how obvious!). For web servers, it is a software program. This program keeps checking for requests for services that arrive on a website. Once a request is received, it sends it to one of the servers in the group of servers supporting the website. Once the server responds, the load balancer sends it to the client who requested it.
Now, how does the load balancer decide on the server it should send a request to? It considers various parameters before choosing a server. It analyzes the load, looks into the availability, and capability of the servers. At times, the load balancer simply follows the round robin method to choose a server. Some load balancers choose the server at random.
Being an intermediary between the client and the server, the load balancer provides a layer of security to the server. We will look into its benefits in one of the later posts.