Skip to content

Instantly share code, notes, and snippets.

Last active May 15, 2017
What would you like to do?
mongodb - maintenance, scaling, monitoring


  • replica sets scales reads
  • sharding scales read and writes

replica sets

  • backup
  • primary and secondary members
  • oplog requires a replica set

primary member

  • only one

secondary member

  • multiple
  • copies-, and repeats the primary oplog after a set delay
  • priority 0 will not become a primary
  • use "hidden" to avoid interference. Suitable for analytics and offline reads. Rquired to be priority 0.


  • only required if even number-, or only one secondary

sharded cluster

  • Cluster of shards. Each shard is a mongod
  • Each shard should be a replica set
  • Requires: shardKey, router mongos, config server


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment