From the course: MongoDB Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Replica set

Replica set

- [Instructor] When multiple Mongo D instances work together and maintain the same data set they are called a replica set. Let's say you configured your MongoDB deployment to be a three member replica set with three normal replica set members. In a replica set, the Mongo D processes take on different roles. One replica set member in each replica set is elected to be the primary. The primary receives all right operations. The rest of the replica set members are secondaries. Secondaries replicate right operations from the primary asynchronously to maintain exactly the same data set. This is how MongoDB uses replication to achieve redundancy, meaning the data is replicated in multiple places. If at any point a primary becomes unavailable, one of the remaining secondaries will call for an election of a new primary, and one of the secondaries will then take over as the new primary. This is how MongoDB achieves high…

Contents