PrepZone Logo
PrepZone
Back to Database

Database · Hard

How does MongoDB sharding work? Shard key selection and chunk migration.

DatabaseNoSQLStaff

Answer preview

Sharding partitions a collection horizontally across multiple replica sets so writes and storage scale beyond one machine. It is MongoDB's answer to a dataset or write rate that a single primary cannot hold.…