MongoDBQuestion 03 of 8
Sharding
Answer out loud or in your head first, then compare.
Answer
Sharding splits data and load across many machines, i.e. it scales the database horizontally. Documents go to shards according to the shard key.
Example: a large set of events can be spread out by a carefully chosen combination of fields, so that not all new writes go to one shard.
To be precise: a good key takes into account how values are distributed and how queries run. A bad one can create a hotspot or force queries to hit every shard.
Pitfall: sharding isn't replication. Replication keeps copies for availability; sharding splits the data set. I check indexes and the model first, before adding cluster complexity.
How did it go? Be honest — “Not yet” puts the question on your review list.