Database Manual / Replication

Replica Set Read and Write Semantics副本集读写语义

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.从客户端应用程序的角度来看,MongoDB实例是作为单个服务器(即“独立”)运行还是作为副本集运行是透明的。但是,MongoDB为副本集提供了额外的读写配置。

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 acknowledgment requested from MongoDB for write operations.写关注描述了MongoDB为写操作请求的确认级别。
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.描述阅读偏好的机制。