Docs Menu
Docs Home
/
MongoDB Manual
/ /

Three Member Replica Sets

On this page

  • Primary with Two Secondary Members (P-S-S)
  • Primary with a Secondary and an Arbiter (PSA)

The minimum number of replica set members needed to obtain the benefits of a replica set is three members. A three member replica set can have either three data-bearing members (Primary-Secondary-Secondary) (Recommended) or if circumstances (such as cost) prohibit adding a third data bearing member, two data-bearing members and an arbiter (Primary-Secondary-Arbiter). [1]

[1] For considerations when using an arbiter, see Replica Set Arbiter.

A replica set with three members that store data has:

  • One primary.

  • Two secondary members. Both secondaries can become the primary in an election.

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 all times in addition to the primary. These replica sets provide additional fault tolerance and high availability. If the primary is unavailable, the replica set elects a secondary to be primary and continues normal operation. 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
click to enlarge

Note

For considerations when using an arbiter, see Replica Set 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 deployments provides only one complete copy of the data. Arbiters require fewer resources, but at the expense of more limited redundancy and fault tolerance.

However, a deployment with a primary, secondary, and an arbiter ensures that a replica set remains available if the primary or the secondary is unavailable. If the primary is unavailable, the replica set 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.
click to enlarge

Tip

See also:

Back

Deployment Architectures