Take the 2-minute tour ×
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.

Huge collections have huge indexes that may not fit into RAM. Is that problem entirely solved with sharding ?

If I have lots of small collections with small indexes, what are the options for storing them ? Since only very few of them would be bigger than 200mb they wouldn't be eligible for sharding. What MongoDB database architecture can hold a huge number of fairly small collections ? Since all the queries would be to a specific collection, would this be as fast as a targeted query in a sharding environment ? Faster ?

share|improve this question
add comment

1 Answer 1

The smaller the collection the better. Yes if the index does not fit into ram it will be come slower. the way most index searching works is based on binary searching. Its a great method. I build a little test last week in PHP and you can have a list of 1000 numbers and you will be able to find each number in about 12.3 comperasons. So think of it that way. If you a table of 1000 items only having to check 12 times to find the correct result is pretty good in my book. The more documents you add in mongo the more operations that have to take place.But its imporant not to make them to small that your server has to keep switching for simple things.

Also make sure to remember that each document has a max size of about 18mb I think. That is a lot of data. Look up how many words are in the book "war and peace" and that can fit in about 3mb of data. But dont let it control you over stuffing things or under stuffing them.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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