-
Book Overview & Buying
-
Table Of Contents
The Official MongoDB Guide
By :
Replication is an essential part of ensuring continuity of service in a database system. Replica sets store their synced state in the operations log (oplog). As each operation takes place, it is written to the primary node’s oplog, which takes the form of a capped collection. Secondary nodes asynchronously stream this oplog, writing operations to their own in the same order.
High volumes of write operations can hamper your primary node’s ability to replicate events to the oplog in real time, which in turn slows down replication to secondary instances. The time it takes to replicate a write operation from the primary to a secondary is called replication lag.
If the time is 4:30 P.M. and your secondary node just applied an operation that was applied on your primary node at 4:25 P.M., you have a replication lag of five minutes.
In a production cluster, the replication lag should be close or equal to 0.
If you’re...