0
0
MongoDBquery~5 mins

Oplog and replication mechanism in MongoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the oplog in MongoDB replication?
The oplog (operation log) is a special capped collection that records all changes to the data in the primary node. Secondary nodes use it to replicate these changes and stay in sync.
Click to reveal answer
beginner
How does MongoDB replication keep data consistent across nodes?
MongoDB replication uses the oplog to copy all write operations from the primary node to secondary nodes. This ensures all nodes have the same data over time.
Click to reveal answer
intermediate
What type of collection is the oplog in MongoDB?
The oplog is a capped collection, meaning it has a fixed size and works like a circular buffer, overwriting old entries when full.
Click to reveal answer
intermediate
What happens if a secondary node falls behind and misses oplog entries?
If a secondary node falls too far behind and oplog entries it needs are overwritten, it must perform a full resync from the primary to catch up.
Click to reveal answer
beginner
Why is the oplog important for MongoDB's replication mechanism?
The oplog allows MongoDB to replicate data efficiently by recording only changes, not full data snapshots, enabling fast and incremental updates to secondaries.
Click to reveal answer
What does the oplog in MongoDB store?
AAll write operations on the primary node
BFull copies of the database
CUser authentication data
DBackup snapshots
What type of collection is the oplog in MongoDB?
ACapped collection
BRegular collection
CView
DTemporary collection
If a secondary node misses oplog entries, what must it do?
ARestart the primary node
BWait for the primary to resend entries
CNothing, it will catch up automatically
DPerform a full resync from the primary
How does MongoDB replication ensure data consistency?
ABy manual data export/import
BBy sharing the same disk storage
CBy copying oplog entries from primary to secondaries
DBy using a single node only
What is the main advantage of using an oplog for replication?
AStoring full backups
BEfficient incremental data updates
CEncrypting data
DFaster query execution
Explain how MongoDB uses the oplog to replicate data between primary and secondary nodes.
Think about how changes on one node get copied to others.
You got /4 concepts.
    Describe what happens when a secondary node falls behind and misses oplog entries in MongoDB replication.
    Consider the fixed size of the oplog and its impact.
    You got /4 concepts.