[DOCS-10517] Documentation on Unique Key for Sharded Cluster wrong Created: 12/Jul/17 Updated: 30/Oct/23 Resolved: 03/Dec/18 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Roy Rim | Assignee: | Kay Kim (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 5 years, 10 weeks, 2 days ago |
| Description |
|
The first sentence on unique keys for sharded clusters on this link says this:
This implies to me that the _id field can be unique across the cluster AND the shard key can be unique as well. Which is wrong. Within a particular shard _id can be unique. But the only index that can be truly unique across the cluster either has to be the shard key or a index that has the shard key as a prefix. We're actually depending/hoping that the _id on its own is unique without enforcing uniqueness (i.e. ObjectID is usually reliably unique). I would rewrite this as:
And add a warning somewhere below that specifically states that the _id can only be unique across the sharded cluster if and only if its the shard key and that when generating _id values that ObjectID or something suitably unique should be used as well. Roy |
| Comments |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Githook User [ 03/Dec/18 ] |
|
Author: {'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}Message: |
| Comment by Brian Moss [ 17/Jan/18 ] |