Skip to main content
InterviewHubPRO
Section Overview
Q40

Question 40 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

80%
MongoDB & NoSQL (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Write Concern vs Read Concern: Distributed Guarantees.

senior LevelSystem Design

In Simple Words:

  • Write Concern (w):
    • w: 1: Primary confirms write in RAM (fastest, risk of data loss on failover).
    • w: 'majority': Write confirmed by a majority of replica set nodes.
    • j: true: Confirmed written to on-disk journal file.
  • Read Concern:
    • 'local' / 'available': Reads node's current local state without consensus.
    • 'majority': Reads data committed by a majority of nodes, preventing reading data rolled back during a primary failover.
    • 'snapshot': Multi-document transactional read isolation.