MongoDB — Replication & High Availability
Learn how 3-node Replica Sets work with Primary node writes, Secondary replication, elections, and oplog sync.
1Replica Set Architecture
A Replica Set in MongoDB is a group of mongod processes that maintain the same data set. It provides redundancy and high availability:
- Primary Node: Receives all write operations.
- Secondary Nodes: Replicate the Primary's Oplog (operations log) asynchronously.
- Automatic Failover: If Primary goes offline, Secondaries elect a new Primary in seconds.