9. Replication & The Oplog
• Replication: Use It!
• Mind the Oplog Size
• Consider Delayed Replication
10. Replica Sets
• One Primary, Many Secondaries
• High Availability ~ Self Healing
• Strongly Consistent
• Hidden Nodes, Delayed SECONDARIES
• Reading from SECONDARIES
• If the PRIMARY goes down, can the remaining
SECONDARIES handle the load?
• Are You Okay With Less Up to Date Data?
• If the answer to either question is no, stick with
reading from PRIMARIES...
11. Replica Sets
Node 1! Node 2!
Secondary! Heartbeat+ Secondary!
Node 3!
Primary! Replication+
Replication+
• Replication is Asynchronous
• Nodes Can Be in Different Datacenters
• Tailing the Oplog
• Monitor Secondary Delay + Oplog Size
14. MongoDB Monitoring Service
• SaaS solution providing instrumentation and
visibility into MongoDB systems
• Free version released
• 5,000+ customers using service
• Installable Version Coming
22. Filesystem Snapshots
• Journaling...
• If turned on, and on the same filesystem,
snapshot at will.
• If not on or mounted somewhere else,
fsync lock required
• Use a filesystem that supports snapshots :-)
25. Queries + Indexes
• Note the Cursor Type (Btree vs. Basic)
• Most Use-Cases: Queries Should be Indexed
• Force No Table Scans
• --notablescan
• Indexes Should Fit in RAM
• Indexes Slow Writes
• Use them when you need them...
• Don’t use them when you don’t...
• Use the Slow Query Log