MongoDB Replication and Replica Sets Flashcards
6 cards from real MongoDB practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 MongoDB Replication and Replica Sets flashcards as text
What is the minimum recommended number of members in a MongoDB replica set for high availability?
Answer: 3
MongoDB recommends a minimum of 3 members for high availability. With 3 members, the replica set can tolerate the failure of one member while still maintaining a majority (2 of 3) required to elect a new primary and continue accepting writes.
What is the role of the oplog in MongoDB replication?
Answer: A capped collection on the primary that records all write operations for secondaries to replicate
The oplog (operations log) is a special capped collection in the local database that records all write operations in an idempotent form. Secondary members tail the primary's oplog and replay operations to stay in sync with the primary.
How does a MongoDB replica set elect a new primary?
Answer: Members vote and a candidate must receive a majority of votes
MongoDB replica set elections use a majority voting protocol. A candidate primary must receive votes from a majority of all voting members (not just available members). This prevents split-brain scenarios in network partitions.
What is a MongoDB arbiter in a replica set?
Answer: A member that holds no data but participates in elections to break ties
An arbiter holds no data and cannot become primary. Its sole purpose is to vote in elections to break ties when an even number of data-bearing members are present. Arbiters use minimal resources but introduce a potential single point of failure.
What is the write concern { w: 'majority' } in MongoDB?
Answer: Writes are acknowledged after being written to a majority of voting replica set members
{ w: 'majority' } ensures MongoDB acknowledges a write only after it has been written to a majority of the replica set's voting members and is durable. This guarantees the write survives the failure of any single member, providing strong durability guarantees.
What happens during a replica set failover when the primary becomes unavailable?
Answer: An election is held among eligible secondaries to elect a new primary
When a primary becomes unavailable, eligible secondary members initiate an election. The secondary with the most up-to-date oplog and sufficient priority that can reach a majority of voting members will be elected as the new primary, typically within seconds.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- 10geneducation.zendesk.com — Test dates, score release, passing score, test delivery, retake policy · verified Oct 2026
- learn.mongodb.com — Eligibility, fees, exam format, time limit · verified Oct 2026