Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save RahulJyala7/43d9e85f4ec159fd1487961e81618b93 to your computer and use it in GitHub Desktop.
Save RahulJyala7/43d9e85f4ec159fd1487961e81618b93 to your computer and use it in GitHub Desktop.
Sharding vs Replication Mongo CheatSheet
Sharding partitions the data-set into discrete parts.
Replication duplicates the data-set.
These two things can stack since they're different. Using both means you will shard your data-set across multiple groups of replicas. Put another way, you Replicate shards; a data-set with no shards is a single 'shard'.
A Mongo cluster with three shards and 3 replicas would have 9 nodes.
3 sets of 3-node replicas.
Each replica-set holds a single shard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment