Three Member Replica Sets

The minimum architecture of a replica set has three members. A threemember replica set can have either three members that hold data, ortwo members that hold data and an arbiter.

Primary with Two Secondary Members

A replica set with three members that store data has:

Diagram of a 3 member replica set that consists of a primary and two secondaries.

These deployments provide two complete copies of the data set at alltimes in addition to the primary. These replica sets provideadditional fault tolerance and high availability. If the primary is unavailable, the replicaset elects a secondary to be primary and continues normaloperation. The old primary rejoins the set when available.

Diagram of an election of a new primary. In a three member replica set with two secondaries, the primary becomes unreachable. The loss of a primary triggers an election where one of the secondaries becomes the new primary

Primary with a Secondary and an Arbiter

A three member replica set with a two members that store data has:

Diagram of a replica set that consists of a primary, a secondary, and an arbiter.

Since the arbiter does not hold a copy of the data, these deploymentsprovides only one complete copy of the data. Arbiters require fewerresources, at the expense of more limited redundancy and faulttolerance.

Note

For the following MongoDB versions, pv1 increases the likelihoodof w:1 rollbacks compared to pv0(no longer supported in MongoDB 4.0+) for replica sets with arbiters:

  • MongoDB 3.4.1
  • MongoDB 3.4.0
  • MongoDB 3.2.11 or earlier

See Replica Set Protocol Version.

However, a deployment with a primary, secondary, and an arbiterensures that a replica set remains available if the primary or thesecondary is unavailable. If the primary is unavailable, the replicaset will elect the secondary to be primary.

Diagram of an election of a new primary. In a three member replica set with a secondary and an arbiter, the primary becomes unreachable. The loss of a primary triggers an election where the secondary becomes new primary.

See also

Deploy a Replica Set.