What is load balancing?

Dividing the load of requests among the set of serving resources is called load balancing.

Within the design of a system, load balancing is performed at various layers like:

  • Globally arriving requests forwarded to individual data centers.
  • Dividing requests coming to a data center among the available web servers, application servers, cache servers, and database servers.

Load balancing helps divide the load evenly among all the resources, efficiently utilize existing resources, reduce user response time, etc.

Load balancing in DNS

We understand that DNS responds with multiple IP addresses for each DNS query. In the lesson on DNS, we discussed that it is possible to do load balancing through DNS while looking at the output of nslookup. DNS uses a trick of changing the order of the IP addresses in response to each DNS query. Thus, different users getting different IPs will result in users visiting a different server to entertain their requests. In this way, DNS distributes the load of requests on different datacenters. Hence, doing global-level load balancing.

DNS can use a simple strategy of round-robin to perform load balancing as shown below:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy