MongoDB Load Balancer for Replica Set

In a MongoDB Replica Set, how can I ensure fast response for matched users when my primary is busy serving another request?

Do I need to use a load balancer, or is mongodb itself directing the request for an available Secondary?

thank

+3


source to share


2 answers


You don't need to use a load balancer or redirect requests to secondary nodes; the primary node can handle concurrent requests on its own:



+6


source


Typically, writes are processed by the master, and reads must be sent to secondary users with a read preference. Although it may take some time to get the data propagated to the secondary users, the secondary users use the oplog copy to replicate the data.

You don't need a load balancer, Mongo is capable of that. Read more about this here -



https://docs.mongodb.com/manual/replication/

0


source







All Articles