codejammer
codejammer

Reputation: 469

Mongodb : Distribution of collections using sharding

The application that we developed is a data crunching application and in this process, there will multiple collections that are created. So, there is a high chance that the maximum limit of 3 million collections (provided we use all the 2GB provided for NS) will be crossed. Can I have different collections distributed in different mongodb instances and manage them using sharding ?

Upvotes: 0

Views: 73

Answers (1)

user508434
user508434

Reputation:

I guess your question is about how to use sharding for distributing collections across the nodes? Sharding is actually meant to be a method to meeting the demands of data growth in terms of amount not number of collections. That means you partition your collection into multiple shards.

To deal with the issue you are having, you could run multiple instances of mongod on the same server that live on their own (not a replica set). You could distribute your collections into these instances. But you will need to hold onto which collection is hosted on which mongod process. You would have to store pid of each mongod processes.

Upvotes: 1

Related Questions