I'm preparing for the MongoDB developer certification and a practice question has me stumped:
Which of the following is true of the mechanics of replication in MongoDB? Check all that apply.
a. Operations on the primary are recorded in a capped collection called the oplog.
b. Members of a replica set may replicate data from any other data-bearing member of the set by default.
c. Clients read from the nearest member of a replica set by default.
I selected just a.
, but b.
is considered true as well.
My understanding is that secondary nodes in a replica set will only poll the primary node's oplog and will only switch to another secondary if the primary goes down and that other secondary becomes the new primary node.
The wording in b.
any other data-bearing member of the set by default implies secondaries can poll each other even if the primary node is still active. I assume this isn't the case. Is my understanding correct?