Skip to main content

Replication for MongoDBs

MongoDB replication keeps copies of data on several servers using a replica set: one primary accepts writes and secondaries copy its oplog. If the primary fails, an election chooses a new one. This unit in the Operations stage also covers write concern, read preference and backups with mongodump or snapshots.

Stage: Operations · Part of the MongoDB roadmap · Last reviewed 19 November 2026

What to learn in Replication

Replication interview questions

What happens when the primary in a MongoDB replica set fails?

The remaining members hold an election, and one with a majority of votes becomes the new primary, usually within seconds. Drivers detect this and retry eligible operations. A set needs a majority of voting members available to elect, which is why odd counts are used.

What does write concern majority mean?

It makes the server acknowledge a write only after a majority of replica set members have applied it. Such data survives a failover, because a majority-acknowledged write is on the node that wins the next election. The cost is slightly higher latency.

Where Replication fits in the MongoDB roadmap

Replication belongs to the Operations stage (advanced level), which takes about 12 hours. Reliability and scale.

Back to the full MongoDB roadmap