4 ms·
Sharding gotchas: You can't shard an existing collection that's surpassed 50GB. All collections are currently created on the primary shard of the database. (A
by dacort 16y ago
Sharding gotchas:
You can't shard an existing collection that's surpassed 50GB.
All collections are currently created on the primary shard of the database. (Although this is slated to change: http://jira.mongodb.org/browse/SERVER-939 http://jira.mongodb.org/browse/SERVER-939 )
If a collection already has a unique key, that has to be your shard key.
You cannot update the value of a shard key.
- eldenbishop 16y agoAnother gotcha with sharding is that during a re-balance some documents will be on "both" shards simultaneously. Thus issuing a count command repeatedly on a 100k doc collection will see the count bounce up as it shards. 100k, 106k, 100k, 104k etc. This is not a problem for lookups of single documents but means any row scans will produce inconsistent values if the collection is re-balancing. There is a certain mode you can trigger for scan queries that may address this but I have not tested it yet. You learn a lot about mongodb just by playing with it. It is super simple to set up and just hammer with different tests. I'm playing around with 4 extra large instances wired to 4 drives each in raid 0 on amazon right now and having a blast.