Quick Answer
Data loss prevention during failover: use w:majority write concern so acknowledged writes are on a majority of nodes. Enable journaling. Size your replica set with 3+ members for a proper majority. Monitor replication lag - excessive lag means secondaries might not have recent writes when failover occurs. Test failover regularly. Atlas automates replica set management and monitors for failover events.
Answer
Primary acknowledges writes only after majority replication. Elections ensure nodes with consistent oplogs become primary, preventing divergence.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
MongoDB interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Perfect for freshers and experienced candidates.