It looks like database sharding is great if I have huge collections. What if I have lots of fairly sized collections ? Let's say that for 1 collection of 100 000 000 documents (not very big comments) sharding is effective. Is it also effective for 10 000 collections with 10 000 documents each ?
(I think this question is still valid for table oriented databases if you replace collections with tables and documents with rows. If possible I'd like to know the theoretical answer as well as the answer in the specific MongoDB scenario, if different from the theoretical answer.)
fooandbarwith the same data structure, you can merge them into thebazcollection and override the_ids(in code):{ _id: "foo123" }, { _id: "bar123" }. You have a larger index, but you have only one index that includes the type. Not a requirement, just "food for thought". – Gates VP Sep 06 '11 at 18:35