Suggest an editImprove this articleRefine the answer for “How does sharding differ from replication?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Replication and sharding solve different problems: replication copies the same data onto several nodes (Primary + Secondary) for fault tolerance and read scaling, while sharding splits data into pieces (shards), each living on its own server, for scaling volume and writes. **Key point:** in one sentence - replication is the same data on several servers (reliability + read scaling), while sharding is different data on different servers (write and volume scaling).Shown above the full answer for quick recall.Answer (EN)Image**Sharding** and **replication** solve different problems, even though both relate to distributed data in MongoDB. ### Replication **Goal:** fault tolerance and read scaling. **The idea:** the same data is copied onto several nodes. - there's a *Primary* and several *Secondaries* - every node holds **the same set of data** - if Primary fails, a Secondary takes over - reads can come from Secondary, taking load off Primary **The key idea:** *several copies for reliability and availability*. ### Sharding **Goal:** scaling by data volume and write load. **The idea:** data is **split into pieces (shards)**, and each piece lives on its own server. - each shard holds **only part of the collection** - load is spread across different nodes - the database can grow almost without limit - writes and reads are distributed across shards **The key idea:** *splitting large data across several machines*. ### In one sentence - **Replication**, the same data on several servers (reliability + read scaling). - **Sharding**, different data on different servers (write and volume scaling). If you'd like, I can give a simple analogy in my next message, something like "replication is like photocopies, while sharding is like chapters of a book kept in different rooms".For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.