MongoDB Associate Database Administrator(Based on MongoDB 6.0 and 7.0+) C100DBA Question # 13 Topic 2 Discussion
C100DBA Exam Topic 2 Question 13 Discussion:
Question #: 13
Topic #: 2
In a replica set with a primary and two secondaries, what should the write concern be set to so only a single node is required to acknowledge a write operation before it is deemed successful?
MongoDB write concern defines the level of acknowledgment requested for a write. Setting the numeric value w: 1 means that a write is considered acknowledged after the primary has accepted it; no secondary acknowledgment is required. In a replica set with one primary and two secondaries, those secondaries can replicate the operation asynchronously after the client has already received success. That configuration is represented by { writeConcern: { w: 1 } }, making option D correct. The numeric type matters: w can be specified as an integer count or certain strings such as " majority " , but the string " 1 " is not the intended numeric node count shown by the question. Options B and C also omit the w field structure expected inside a write concern document. The durability trade-off is important: a w:1 write can be acknowledged before any secondary has replicated it, so a sudden primary failure before replication may result in that write being rolled back after failover. If the workload requires stronger durability, w: " majority " is commonly used. For exactly one acknowledging node, however, the correct setting is D.
Study Guide reference/topic:Cluster Reliability and Data Resilience - write concern, w acknowledgments, replica-set durability, and rollback risk.
===========
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit