Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had a few questions around deployment best practices and how folks are using mongodb today. Feel free to add any other comments you can think off.

No of databases per mongod instance. Is the recommendation to create multiple databases in a single mongod instance or to run many mongod's on the same box for the different DBs. Also how are folks running doing this for dev and prod envs?

Ideal number of shards per cluster. How does one decide the ideal number?

Recommended replicaset. 3 or more and how does one decide?

Best way to backup and restore. Is it to use mongodump or is something else? Also do you usually do it on the cluster/instance level vs database level?

Cloning of databases or clusters. Does anyone actively clone and do you clone a db or the whole cluster/instance?

1 Answer
1

There is one reason to have multiple mongod instances in one machine (other than machine efficient repset setups) and that one reason is the process wide write lock. If you run into a situation where you're bottlenecked by the write lock rather than any hardware resource bottleneck you can go for multiple mongod instances. In all other situations it's usually more practical to have one mongod process, especially given it's memory mapped based storage engine.

There's no ideal number. Adding shards (almost) linearly scales up write and read performance for sharded collections. It's a basic horizontal scaling solution and follows the rules for that sort of scaling.

Replica sets always consist of at least 3 members although 1 of them can be an arbiter (votes but does not replicate). If you add more you gain read performance if your application uses slaveOk flagged queries. Again, ideal number depends on your use case.

Depends. Most people use a hot backup scheme of some sort. There's no difference between MySQL backup conventions and MongoDB here.

Depends on whether or not you want to clone a single database or the entire cluster? Both are well documented.