Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (31 sloc) 1.6 KB
Replica Set Read and Write Semantics
.. default-domain:: mongodb
From the perspective of a client application, whether a MongoDB
instance is running as a single server (i.e. "standalone") or a
:term:`replica set` is transparent.
By default, in MongoDB, read operations to a replica set return results
from the :doc:`primary </core/replica-set-primary>`.
Users may configure :term:`read preference` on a per-connection basis
to prefer that the read operations return results from the
:term:`secondary` members. If clients configure the :term:`read
preference` to permit secondary reads, read operations can return data
from :term:`secondary` members that have not replicated more recent
write operations.
This behavior is sometimes characterized as :term:`eventual
consistency` because the secondary member's state will *eventually*
reflect the primary's state and MongoDB cannot guarantee :term:`strict
consistency` for read operations from secondary members.
.. note::
- In MongoDB, clients can see the results of writes before they are
made durable:
.. include:: /includes/list-visibility-of-data.rst
- :term:`Sharded clusters <sharded cluster>` where the shards are
also replica sets provide the same operational semantics with
regards to write and read operations.
.. include:: /includes/toc/dfn-list-replica-set-read-write-semantics.rst
.. include:: /includes/toc/replica-set-read-write-semantics.rst
.. [#edge-cases-2-primaries]
.. include:: /includes/footnote-two-primaries-edge-cases.rst
Jump to Line
Something went wrong with that request. Please try again.