Clients send write operations to the primary
node, and it applies the operation and writes it to its oplog
. The secondary members will copy and apply primary's oplog
in order to duplicate the primary's dataset. This procedure happens in an asynchronous replication.
Clients can't send the write operation to secondary
nodes, but they can send read operations to secondaries. By default, all clients send both read/write operations to the primary
node. However, modifying the configurations can change this.
In order to get information about each node's availability, nodes direct ping messages to each other to show their availability, as illustrated in the following diagram:
In some situations, the primary
node might become unavailable. If the primary
node doesn't communicate with other members for more than 10 seconds, the replica set will conduct an election to choose a new primary
node from the secondary members.