@@ -213,7 +213,7 @@ the cluster. See also :ref:`sharding strategy <sharding-strategy>`.
213
213
214
214
At minimum, consider the consequences of the
215
215
:ref:`cardinality<shard-key-range>`, :ref:`frequency<shard-key-frequency>`, and
216
- rate of :ref:`change <shard-key-monotonic>` of a potential shard key.
216
+ :ref:`monotonicity <shard-key-monotonic>` of a potential shard key.
217
217
218
218
.. note::
219
219
@@ -269,11 +269,12 @@ inserts may look similar to the following:
269
269
The cluster in this example would *not* scale horizontally, as incoming writes
270
270
would only route to a subset of shards.
271
271
272
- A shard key with high cardinality does not guarantee even distribution of data
273
- across the sharded cluster, though it does better facilitate horizontal
274
- scaling. The :ref:`frequency <shard-key-frequency>` and :ref:`rate of
275
- change <shard-key-monotonic>` of the shard key also contributes to data
276
- distribution. Consider each factor when choosing a shard key.
272
+ Choosing a shard key with high cardinality does not, on its own,
273
+ guarantee even distribution of data across the sharded cluster. The
274
+ :ref:`frequency <shard-key-frequency>` and
275
+ :ref:`monotonicity <shard-key-monotonic>` of the shard key also
276
+ contribute to data distribution. Take each factor into account when
277
+ choosing a shard key.
277
278
278
279
If your data model requires sharding on a key that has low cardinality,
279
280
consider using a :term:`compound index` using a field that
@@ -298,19 +299,21 @@ distribution of inserts may look similar to the following:
298
299
299
300
.. include:: /images/sharded-cluster-ranged-distribution-frequency.rst
300
301
301
- A shard key with low frequency does not guarantee even distribution of data
302
- across the sharded cluster. The :ref:`cardinality <shard-key-cardinality>` and
303
- :ref:`rate of change <shard-key-monotonic>` of the shard key also contributes
304
- to data distribution. Consider each factor when choosing a shard key.
302
+ Choosing a shard key with low frequency does not, on its own, guarantee
303
+ even distribution of data across the sharded cluster.
304
+ The :ref:`cardinality <shard-key-cardinality>` and
305
+ :ref:`monotonicity <shard-key-monotonic>` of the shard key also
306
+ contribute to data distribution. Take each factor into account when
307
+ choosing a shard key.
305
308
306
309
If your data model requires sharding on a key that has high frequency
307
310
values, consider using a :term:`compound index` using a unique or
308
311
low frequency value.
309
312
310
313
.. _shard-key-monotonic:
311
314
312
- Monotonically Changing Shard Keys
313
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315
+ Shard Key Monotonicity
316
+ ~~~~~~~~~~~~~~~~~~~~~~
314
317
315
318
A shard key on a value that increases or decreases monotonically is more
316
319
likely to distribute inserts to a single shard within the cluster.
@@ -336,11 +339,12 @@ distribution of inserts may look similar to the following:
336
339
If the shard key value was monotonically decreasing, then all inserts would
337
340
route to ``Chunk A`` instead.
338
341
339
- A shard key that does not change monotonically does not guarantee even
340
- distribution of data across the sharded cluster. The
341
- :ref:`cardinality<shard-key-cardinality>` and
342
- :ref:`frequency<shard-key-frequency>` of the shard key also contributes to
343
- data distribution. Consider each factor when choosing a shard key.
342
+ Choosing a shard key that does not change monotonically does not, on
343
+ its own, guarantee even distribution of data across the sharded cluster.
344
+ The :ref:`cardinality<shard-key-cardinality>` and
345
+ :ref:`frequency<shard-key-frequency>` of the shard key also contribute
346
+ to data distribution. Take each factor into account when choosing a
347
+ shard key.
344
348
345
349
If your data model requires sharding on a key that changes
346
350
monotonically, consider using :doc:`/core/hashed-sharding`.
0 commit comments