Recall & Review
beginner
What is the purpose of an election process in a database context?
The election process is used to select a primary or leader node among multiple nodes to coordinate tasks and maintain consistency.
Click to reveal answer
beginner
In MongoDB replica sets, what triggers an election?
An election is triggered when the current primary node becomes unavailable or steps down, so a new primary can be chosen.
Click to reveal answer
intermediate
What role does a 'secondary' node play during an election in MongoDB?
Secondary nodes vote to elect a new primary and can become primary if they receive enough votes.
Click to reveal answer
intermediate
How does MongoDB ensure only one primary is elected during the election process?
MongoDB uses a majority voting system where a candidate must receive votes from more than half of the voting nodes to become primary.
Click to reveal answer
beginner
Why is the election process important for database availability?
It ensures the database can continue accepting writes by quickly selecting a new primary if the current one fails, maintaining availability.
Click to reveal answer
What happens when the primary node in a MongoDB replica set fails?
✗ Incorrect
When the primary fails, MongoDB triggers an election to select a new primary to maintain write availability.
Who votes in the MongoDB election process?
✗ Incorrect
All voting members, including arbiters and secondaries, participate in the election to choose a primary.
What is required for a candidate to become primary in MongoDB?
✗ Incorrect
A candidate must receive votes from more than half of the voting nodes to become primary.
What is the role of an arbiter in MongoDB elections?
✗ Incorrect
Arbiters participate in voting to help break ties but do not hold data.
Why is it important that only one primary exists at a time?
✗ Incorrect
Having a single primary prevents conflicting writes and keeps data consistent.
Explain the election process in MongoDB replica sets and why it is important.
Think about how MongoDB keeps the database writable and consistent when a primary node goes down.
You got /5 concepts.
Describe the roles of primary, secondary, and arbiter nodes during an election.
Consider who votes and who can become the leader.
You got /3 concepts.