Skip to content

Commit 2a22699

Browse files
author
Bob Grabar
committed
DOCS-293 minor edits
1 parent 81a81c8 commit 2a22699

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source/administration/sharding.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -805,13 +805,16 @@ that is not increasing in value. For example in some cases you could
805805
reverse all the bits of your shard key, which preserves information
806806
while avoiding the increasing sequence of values.
807807

808-
:term:`BSON` :term:`ObjectIds <ObjectId>` increase in value with each
809-
insert. To more evenly distribute inserts based on this property, you
810-
might want at generation time to reverse the bits of the ObjectIds or to
811-
swap the first and last 16-bit words, to "shuffle" the inserts.
812-
Alternatively you might use UUIDs instead, but check that your UUID
813-
generator does not generate consistent increasing UUIDs, which would
814-
cause the same behavior.
808+
:term:`BSON` :term:`ObjectIds <ObjectId>` are one case of a value that
809+
monotonically increases during an insert. If you use :term:`ObjectId` as
810+
a shard key, then you can do either of the following at generation time
811+
to more evenly distribute inserts based on this property:
812+
813+
- Reverse the bits of the ObjectIds, or
814+
- Swap the first and last 16-bit words, to "shuffle" the inserts.
815+
- Use UUIDs instead, but check that your UUID generator does not
816+
generate consistent increasing UUIDs, which would cause the same
817+
behavior.
815818

816819
.. example:: The following example, in C++, swaps the leading and
817820
trailing 16-bit word of object IDs generated so that they are no

0 commit comments

Comments
 (0)