I've read a lot about sharding and have gone through cluster setup process as well. What I can't get my head around is the actual database capacity after its sharded.

So say for instance I have one master server + 3 config servers + 5 shards.

If master has 30 GB available, each shard has 40 GB and each of the config servers have available space of 20 GB, what is my total capacity for a sharded collection in the cluster?

Is it 230 GB? How do I find this out? Is there a command that I can run?

Also, as I scale out, wouldn't that put more and more stress on the master node in terms of resources/bandwidth? Can I have multiple masters? Or replication across two sets of clusters?

Thanks in advance :D


The config servers only hold metadata about which chunk is stored on which cluster, no actual data.

There is no such thing called a "master server" in mongoDB, but I think what you are talking about is the shard router (mongos). When that is the case, then that server doesn't store any data at all.

So the total capacity of the cluster is the sum of the capacity of your shards, which is 40GB * 5 = 200GB.

Should the mongo router become a bottleneck, you can add more of them. A cluster can be accessed by any number of routers. By the way: it's not uncommon to put the mongos process(es) on the same machines where the application(s) are running.

"Or replication across two sets of clusters?"

Replication in MongoDB is on shard-level. Each shard can (and in a production setup should) be a replica-set of two or more nodes.

| improve this answer | |
  • Thanks for your answer @philipp. So I understand that shard servers are the ones that actually store data. Is there a way to find out available cluster storage automatically? Like via command line or API call? Also, can the shard servers be added during runtime without bringing the cluster down? Most tutorials suggest that the shards should be set during startup which seems to suggest that there will be downtime, however, I'm not too sure. – Manthan Dave Jan 18 '16 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.