C100DBA · Question #23
Which node in a replica set does accept write operation?
The correct answer is C. primary. In a MongoDB replica set, only the primary node accepts write operations - all writes are directed to it, and changes are then replicated asynchronously to secondaries. An arbiter (A) participates in elections to break ties but holds no data and cannot serve reads or writes…
Question
Which node in a replica set does accept write operation?
Options
- Aarbiter
- Bhidden
- Cprimary
- Dsecondary
How the community answered
(32 responses)- A3% (1)
- B3% (1)
- C88% (28)
- D6% (2)
Explanation
In a MongoDB replica set, only the primary node accepts write operations - all writes are directed to it, and changes are then replicated asynchronously to secondaries. An arbiter (A) participates in elections to break ties but holds no data and cannot serve reads or writes. Hidden nodes (B) are special secondaries that are invisible to client applications and can only serve internal purposes like backups - no direct writes. Secondary nodes (D) replicate data from the primary and can serve reads (if enabled), but never accept writes directly.
Memory tip: Think "Primary = Pen" - only the primary holds the pen to write.
Topics
Community Discussion
No community discussion yet for this question.