Suggest an editImprove this articleRefine the answer for “What is sharding in MongoDB?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Sharding in MongoDB is a horizontal-scaling mechanism where data from a single collection is spread across different servers (shards): each shard holds only part of the data, and together they look like a single database. **Key point:** a cluster consists of Shards (hold the data), Config servers (metadata about where documents live), and Mongos (a query router); data gets distributed based on a shard key - the field MongoDB uses to decide where to place a document.Shown above the full answer for quick recall.Answer (EN)ImageSharding in MongoDB is a **horizontal-scaling mechanism** where **data from a single collection is spread across different servers (shards)**. Each shard holds *only part of the data*, and together they look like a single database. The goal is handling large data volumes and heavy read/write load. ### How this works A sharded cluster consists of: | Component | Role | |---|---| | Shards | hold the actual data (each holds only its part) | | Config servers (CSRS) | hold metadata about which documents live where | | Mongos | a router: accepts the client's request and directs it to the right shard | ### What data gets split on Sharding requires picking a **shard key**, the field MongoDB uses to decide where to place a document. For example: ```javascript { shardKey: 1 } ``` Documents with different shard key values end up on different shards. ### What this gives you 1. **Data-volume scaling**, a collection can grow almost indefinitely 2. **Write scaling**, load is spread across servers 3. **Read scaling**, queries run in parallel across different shards 4. **Performance**, there's no bottleneck at a single server ### When this is needed - there's more data than one server can handle - there's a high volume of writes/queries - collections grow faster than hardware can scale vertically ### Summary Sharding means spreading data across several servers, so MongoDB can handle large volumes and heavy load while staying fast and scalable.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.