C100DBA · Question #66
In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member…
The correct answer is B. 2. Option B (2) is correct because in a 7-member sharded replica set, setting the write concern j to 2 means MongoDB requires at least 2 members (typically the primary plus one secondary) to acknowledge that the write has been committed to the on-disk journal before confirming…
Question
In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member of j?
Options
- A1
- B2
- C0
- D7
How the community answered
(39 responses)- A15% (6)
- B74% (29)
- C8% (3)
- D3% (1)
Explanation
Option B (2) is correct because in a 7-member sharded replica set, setting the write concern j to 2 means MongoDB requires at least 2 members (typically the primary plus one secondary) to acknowledge that the write has been committed to the on-disk journal before confirming success - this ensures durable writes survive a single-node failure.
Why the distractors are wrong:
- A (1): Requiring only 1 member to journal-acknowledge (the primary alone) offers no protection if the primary crashes immediately after - data could be lost on failover.
- C (0): Setting
j: 0disables journal acknowledgment entirely, meaning MongoDB doesn't wait for the write to persist to disk - maximum risk of data loss on crash. - D (7): Requiring all 7 members to journal-acknowledge before confirming the write is impractical - it maximizes durability but cripples write throughput and introduces high latency.
Memory tip: Think of j like a "witness count" - you need at least 2 witnesses (primary + 1 secondary) to ensure a write is safely journaled beyond a single point of failure. In replica set write concern, 1 = risky, 2 = safe minimum, all = overkill.
Topics
Community Discussion
No community discussion yet for this question.