Why using sharding with MongoDB?
We started to use MongoDB at work. So far so good however I was asked to assess if MongoDB could do Replica Set and Sharding at the same time. After searching for a while I find out that yes it can but sharding should be avoiding unless really necessary.
I've read somewhere that with MongoDB you really need to have a lot of document ( like billions ) to start thinking about Sharding, however I fail to comprehend this since the organisation and size of an average document is not mentione开发者_开发知识库d in those "stats".
The criteria we have now is that the RAM should be greater than the memory load needed to complete a request.
These leads me to those question : What are the instructions for MongoDB and SQL server to know what is used in RAM for a request ?
What are the key requirements to use Sharding with MongoDB ?
Can someone point me to a article, post or anything when a person explains why they used Sharding with MongoDB ?
How does MongoDB handles Auto-Sharding ?
Thank you.
From what I understand your working set (the data that you access the most frequently) must fit in RAM for good performances. If it does not, then sharding can be an option.
Replica sets allows to distribute reads accross the set, while sharding can also serve to distribute writes.
There is a book called 'scaling mongodb' at O'Reilly explaining how and when using replica sets and shards.
You can also look at this page: http://www.mongodb.org/display/DOCS/Sharding+Introduction
精彩评论