Architecture of replica sets
After learning the replication process, we can go ahead and learn about the replica set architecture. In order to create a readily available MongoDB server, you can simply use the replica set network.
So, what is replica set?
A replica set is a group of mongod
instances that host the same dataset (http://docs.mongodb.org/manual/core/replication-introduction/).
Each replica set consists of different members and each one is responsible for a particular task. The following list shows you all the possible roles for each member:
Primary
: Aprimary
node is responsible for accepting all read/write operations from clients. Each replica set can have one and only oneprimary
node. Under some conditions, aprimary
node can becomesecondary
or asecondary
node can becomeprimary
by an election process.Secondary
: Thesecondary
nodes host the same dataset asprimary
nodes. Each replica set can have one or moresecondary
nodes. It's possible that asecondary
node changes its...