Suggest an editImprove this articleRefine the answer for “What is a shard key (the sharding key)?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A shard key is a field (or set of fields) in a document that MongoDB uses to distribute data across shards: it determines which server a given document ends up on, and documents with different `shardKey` values end up on different shards. **Key point:** a shard key needs to be evenly distributed (so load doesn't pile onto a single shard) and used often in queries, so more queries can be routed to one specific shard instead of a broadcast to all of them.Shown above the full answer for quick recall.Answer (EN)ImageA shard key is a **field (or set of fields) in a document that MongoDB uses to distribute data across shards**. It's exactly what determines which server a given document ends up on. ### Why a shard key is needed - to **split data into pieces** - to **spread the load evenly** - so queries can run **against the shard they need, instead of all of them** ### The core idea If you pick a shard key, e.g.: ```js { shardKey: 1 } ``` then documents with different `shardKey` values end up on **different shards**, rather than one server. ### Requirements A shard key needs to be: - **evenly distributed** (so load doesn't pile onto one shard) - **used often in queries**, so more queries can go to *one specific shard* (rather than broadcasting to all) ### Summary **A shard key is the field that determines how documents get distributed across shards**, and the whole sharded cluster's efficiency depends on choosing it well.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.