educative.io

Educative

Load balancing layer at three places

We can add a Load balancing layer at three places in our system:

  1. Between Clients and Application servers
  2. Between Application Servers and database servers
  3. Between Application Servers and Cache servers

Why do we need load balancer in 2 and 3 above? Won’t the load balancer already be built into the nosql db and distributed cache?

1 Like

Hi,

We need Load balancing in:

  1. Between Application Servers and database servers
  2. Between Application Servers and Cache servers

because there will be multiple database and cache servers and we need a Load Balancer to manage the requests from the Application Servers.

But if we’re using hash based partitioning in out database servers then using a hash function we would be able to to know what node contains the data we’re looking for so no need for load balancers.

In the case of cache servers we only need 170 GB max to store hot URLs so no need for multiple servers.

I would only put a LB between App servers and Clients

1 Like