Skip to content

Read prefs improvements #1646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions source/core/read-preference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ read preference modes:
If you have application servers in multiple data centers, you may
consider having a :ref:`geographically distributed replica set
<replica-set-geographical-distribution>` and using a non primary read
preference or the :readmode:`nearest`. This reduces network latency by
having the application server to read from a nearby secondary, rather
than a distant primary.
preference or the :readmode:`nearest`. This allows the client to read
from the lowest-latency members, rather than always reading from the
primary.

- Maintaining availability during a failover.

Expand Down Expand Up @@ -82,8 +82,7 @@ read preference modes.

.. include:: /includes/read-preference-modes-table.rst

You can specify a read preference mode on connection objects, database
objects, collection objects, or per-operation. The syntax for specifying
The syntax for specifying
the read preference mode is :api:`specific to the driver and to the
idioms of the host language <>`.

Expand Down Expand Up @@ -115,10 +114,8 @@ behavior <replica-set-read-preference-behavior>`. See also the
Tag Sets
--------

Tag sets allow you to specify custom :doc:`read preferences
</core/read-preference>` and :ref:`write concerns
<write-operations-write-concern>` so that your application can target
operations to specific members.
Tag sets allow you to target read operations to specific members of a
replica set.

Custom read preferences and write concerns evaluate tags sets in
different ways. Read preferences consider the value of a tag when
Expand All @@ -133,11 +130,11 @@ You can specify tag sets with the following read preference modes:
- :readmode:`secondaryPreferred`
- :readmode:`nearest`

Tags are not compatible with :readmode:`primary` and, in general, only
Tags are not compatible with mode :readmode:`primary` and, in general, only
apply when :ref:`selecting <replica-set-read-preference-behavior-member-selection>`
a :term:`secondary` member of a set for a read operation. However, the
:readmode:`nearest` read mode, when combined with a tag set will select
the nearest member that matches the specified tag set, which may be a
:readmode:`nearest` read mode, when combined with a tag set, selects
the matching member with the lowest network latency. This member may be a
primary or secondary.

All interfaces use the same :ref:`member selection logic
Expand Down
4 changes: 2 additions & 2 deletions source/includes/read-preference-modes-table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
members but if no :term:`secondary` members are available,
operations read from the :term:`primary`.
* - :readmode:`nearest`
- Operations read from the *nearest* member of the :term:`replica
set`, irrespective of the member's type.
- Operations read from member of the :term:`replica
set` with the least network latency, irrespective of the member's type.