Skip to content

Commit 646b121

Browse files
author
Sam Kleinman
committed
DOCS-480
1 parent 233b3b0 commit 646b121

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

source/applications/replication.txt

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ behavior <replica-set-read-preference-behavior>`. See also the
327327
the host with the shortest ping time and all other members of
328328
the set that are within the "local threshold," or acceptable
329329
latency. See :ref:`replica-set-read-preference-behavior-nearest`
330-
for more information.
330+
for more information.h
331331

332332
.. For I/O-bound users who want to distribute reads across all
333333
members evenly regardless of ping time, set
@@ -353,15 +353,43 @@ Tag Sets
353353
~~~~~~~~
354354

355355
Tag sets allow you to specify custom :ref:`read preferences
356-
<replica-set-read-preference>` so that your application can target read
357-
operations to specific members, based on custom parameters. Tag sets
358-
make it possible to ensure that read operations target members in a
359-
particular data center or target :program:`mongod` instances designated
360-
for a particular class of operations, such as reporting or analytics.
356+
<replica-set-read-preference>` so that your application can target
357+
read operations to specific members, based on custom parameters. A tag
358+
set for a read operation may resemble the following:
359+
360+
.. code-block:: javascript
361+
362+
{ "dc": "east", "use": "reporting" }
363+
364+
To fulfill the request, a member would need to have both of these tag
365+
sets. Therefore the following tag sets, would satisfy this
366+
requirement:
367+
368+
.. code-block:: javascript
369+
370+
{ "dc": "east", "use": "reporting" }
371+
{ "dc": "east", "use": "reporting", "rack": 1 }
372+
{ "dc": "east", "use": "reporting", "rack": 4 }
373+
{ "dc": "east", "use": "reporting", "disk": "ssd"}
374+
375+
However, the following tag sets would *not* be able to fulfill this query:
376+
377+
.. code-block:: javascript
378+
379+
{ "dc": "east" }
380+
{ "use": "reporting" }
381+
{ "dc": "east", "use": "production" }
382+
{ "dc": "east", "use": "production", "rack": 3 }
383+
{ "dc": "west", "use": "reporting", "disk": "ssd" }
384+
385+
386+
Therefore, tag sets make it possible to ensure that read operations
387+
target specific members in a particular data center or
388+
:program:`mongod` instances designated for a particular class of
389+
operations, such as reporting or analytics.
361390
For information on configuring tag sets, see
362391
:ref:`replica-set-configuration-tag-sets` in the
363392
:doc:`/reference/replica-configuration` document.
364-
365393
You can specify tag sets with the following read preference modes:
366394

367395
- :readmode:`primaryPreferred`
@@ -379,7 +407,7 @@ Tags apply only when :ref:`selecting
379407
All interfaces use the same :ref:`member selection logic
380408
<replica-set-read-preference-behavior-member-selection>` to choose the
381409
member to which to direct read operations, basing the choice on read
382-
preference mode and tag sets.
410+
preference mode and tag sets.
383411

384412
For more information on how read preferences :ref:`modes
385413
<replica-set-read-preference-modes>` interact with tag sets, see the

0 commit comments

Comments
 (0)