Replica Set Read and Write Semantics
MongoDB 5.0 is end of life as of October 2024. This version of the documentation is no longer
supported. To upgrade your 5.0 deployment, see the MongoDB 6.0 upgrade procedures.
From the perspective of a client application, whether a MongoDB instance is running as a single server (i.e. "standalone") or a replica set is transparent. However, MongoDB provides additional read and write configurations for replica sets.
Note
Sharded clusters where the shards are also replica sets provide the same operational semantics with regards to write and read operations.
- Write Concern for Replica Sets
- Write concern describes the level of acknowledgement requested from MongoDB for write operations.
- Read Preference
- Read preference specifies where (i.e. which members of the replica set) the drivers should direct the read operations.
- Server Selection Algorithm
- Describes the mechanics of read preference.