Need Assistance?

support@tutorialshub.in

Transactions, Replication & Sharding

Sharding & Horizontal Scaling

ADVERTISEMENT
MongoDB Free Lesson
5 min read
ADVERTISEMENT

When a single server's RAM, CPU, or disk isn't enough, Sharding splits a large collection across multiple machines (shards) using a Shard Key. A mongos router directs each query to the right shard automatically.

Choosing a Good Shard Key

Pick a shard key with high cardinality and even write distribution (avoid monotonically increasing keys like timestamps alone, which create hot shards).

ADVERTISEMENT
Hi, I'm Tuby! Here to help you