When the replica set is first initialized, all the data from all member servers is copied to all the replica set members. The only exception is the local database, which contains, among other things, the oplog. After the initial synchronization, when read and write requests are received by the primary, it first performs the operation requested by a mongo shell instance or application code, and then records the MongoDB commands actually executed in a special capped collection, local.oplog.rs, referred to as the oplog. The actual synchronization process itself does not involve copying actual data between the primary and its secondaries. Rather, synchronization consists of secondaries receiving a copy of local.oplog.rs. Once the copy is received, the secondary applies the operations in an asynchronous manner.
Let...