Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB load balancing

Tags:

mongodb

I was looking at best load balancing option for concurrent users with Mongo DB. I have looked at Master Slave replication but don't think this will load balance. Are there any open source DB load balancers for Mongo DB?

I have looked at Sequoia but looks like that project is no longer actively supported.

Please note: The data is not very huge & also not use case for sharding.

like image 903
isobar Avatar asked Mar 31 '11 13:03

isobar


People also ask

What is load balancing in MongoDB?

Database load balancing distributes concurrent client requests to multiple database servers to reduce the amount of load on any single server. This can improve the performance of your database drastically.

How MongoDB is horizontally scalable?

To scale horizontally, MongoDB provides you with a built-in mechanism to distribute the data across multiple servers. This process is called sharding and can be done through a toggle button available in the configuration screen of the Atlas UI. The sharding process can also be done with no downtime whatsoever.

Is MongoDB Atlas Sharded?

MongoDB Atlas provides horizontal scale-out for databases using a technique called sharding, which is transparent to applications. MongoDB distributes data across multiple Replica Sets called shards.

Does MongoDB support horizontal scaling out?

FAQs on Scaling MongoDB Yes! As a modern, non-relational database, MongoDB is designed to efficiently handle large datasets through both horizontal and vertical scaling.


1 Answers

both Master Slave and Replica Sets will load balance in MongoDB, if you set slaveOK in your driver.

When slaveOK is enabled MongoDB drivers direct all reads to secondaries/slaves.

This provides relatively effective read balancing; for write balancing your only option.would be sharding.

like image 71
Brendan W. McAdams Avatar answered Oct 02 '22 12:10

Brendan W. McAdams