Recall & Review
beginner
What is write concern in MongoDB?
Write concern is a setting that tells MongoDB how sure it should be that a write operation has been saved before reporting success.
Click to reveal answer
beginner
What does
w: 1 mean in MongoDB write concern?It means the write operation must be acknowledged by the primary server only before reporting success.
Click to reveal answer
intermediate
How does
w: 'majority' affect data durability?It ensures the write is confirmed by the majority of replica set members, increasing data safety in case of failure.
Click to reveal answer
intermediate
What is the role of
j: true in write concern?It requires the write to be committed to the journal on disk, improving durability by protecting against power loss.
Click to reveal answer
advanced
Why might you choose a lower write concern like
w: 0?To improve performance by not waiting for any acknowledgment, but this risks losing data if the write fails.
Click to reveal answer
What does write concern control in MongoDB?
✗ Incorrect
Write concern controls how many servers must confirm a write operation before it is considered successful.
What does
w: 'majority' ensure?✗ Incorrect
w: 'majority' means the write must be acknowledged by most members of the replica set.What does setting
j: true do?✗ Incorrect
j: true ensures the write is saved to the journal on disk for durability.Which write concern gives no acknowledgment of write success?
✗ Incorrect
w: 0 means no acknowledgment is required, so the client does not wait for confirmation.Why is a higher write concern better for data durability?
✗ Incorrect
Higher write concern means more servers confirm the write, making data loss less likely.
Explain what write concern is and how it affects data durability in MongoDB.
Think about how many servers must say 'I saved it' before you trust the write.
You got /3 concepts.
Describe the difference between
w: 1, w: majority, and w: 0 write concerns.Consider how many confirmations each setting requires.
You got /3 concepts.