Skip to main content

MongoDB Replication

Documentation

Replica sets

A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability.

A replica set contains several data bearing nodes (one Primary and multiple Secondary) and optionally one Arbiter node.

Data synchronization model

Replicas pull updates from other replicas instead of receiving them pushed from a primary server. This approach enhances control over data transmission and allows for more flexible network configurations, improving performance and fault tolerance.

Studies:

Read and write semantics

mongodb.com/docs/manual/applications/replication

Write concern

mongodb.com/docs/manual/core/replica-set-write-concern, mongodb.com/docs/manual/reference/write-concern

Read concern

mongodb.com/docs/manual/reference/read-concern

Read preference

mongodb.com/docs/manual/core/read-preference

Causal consistency

Documentation