Deployment best practices and case studies

105 views
Skip to first unread message

ankitb

unread,
Jun 18, 2012, 2:14:07 PM6/18/12
to mongod...@googlegroups.com
Hi, 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?

Thanks


ankitb

unread,
Jun 19, 2012, 12:42:42 PM6/19/12
to mongod...@googlegroups.com
Hi Folks, any comments/guidance on the points below?

Thanks

Jenna

unread,
Jun 19, 2012, 4:04:47 PM6/19/12
to mongodb-user
# of databases: In MongoDB version 2.2 (the next stable release) there
is database-level locking (currently there's a global write lock),
which may be a reason to create multiple databases.

# of shards: This question depends upon your use case, and the metrics
of your system are necessary to provide specific advice. You need to
consider expected write volume as well as data size. If your data
fits in RAM, you'll be able to handle more inserts per second than if
you're forced to go to disk. It's probably a good idea to limit the
data on a single node to 70% of available disk space (filling the disk
to 100% should be avoided at all costs).

# of replicas: 3 nodes in a replica set is recommended for data
durability. If you expect a high number of reads (much greater than
writes), additional replicas will help to spread the load. Additional
replica members will increase fault tolerance, which may be important
for your application. In addition, you may find it beneficial to have
a single replica lag behind the rest as a way to jump back in time
(if, for example, a bug in your application corrupts the data on your
primary).

ankitb

unread,
Jun 19, 2012, 4:30:39 PM6/19/12
to mongod...@googlegroups.com
Great thanks for the reply. Very helpful indeed. 

Stephen Steneker

unread,
Jun 20, 2012, 2:26:22 AM6/20/12
to mongod...@googlegroups.com
Are the 3 replica nodes two standard and one arbitrer?

Hi Filippo,

The recommended minimum of 3 nodes in a replica set is either comprised of two full nodes and an arbiter, or three full nodes.


Cheers,
Stephen

Filippo De Luca

unread,
Jun 20, 2012, 9:42:18 AM6/20/12
to mongod...@googlegroups.com
Thank you
P.s. I'm at mongodb uk right now

Jenna

unread,
Jun 21, 2012, 4:56:13 PM6/21/12
to mongodb-user
Great!
I wanted to add additional comments to my original response.
Separating your data into multiple databases makes the data more
portable since the files are separate, makes it easier to store the
data on separate disks, as well as gives you the option of specifying
different authentication schemes or backup strategies per database.
Enjoy MongoDB UK!
Reply all
Reply to author
Forward
0 new messages