educative.io

Why load balancer b/w application server and database server?

Hi Educative.io,
Idealy there would be only one database for one objective. Although it may be distributed but there will be one instance say for one table. Why load balancer will be required b/w application server and database server.

If one service is running on multiple node then load balancer is required to transfer the request to be processed by that service to one particular node.

These load balancers will be used to distribute the read traffic. Imagine a master-slave configuration with one master and two slaves. All writes will go to master and then replicated to slaves. Reads can happen form any server. Therefore, the load balances can round-robin the read traffic among these three servers.

Hope this clarify your question.

1 Like

Load balancer will also be used to figure out which database to go to if we are using partitioning