What Are the Differences Between Shard Keys and Sort Keys?
Table 1 shows the comparison between shard keys and sort keys.
Dimension |
Shard Key |
Sort Key |
---|---|---|
Scenario |
A shard key determines in which shard a KV item is stored. In a user table, for example, you can specify the username field as the shard key. KVS then stores KV items with the same username in the same shard. |
KV items with the same shard key are stored by sort key. You can query data by sort key. |
Primary keys supported |
Simple primary key (shard key) and composite primary key (shard key and sort key). |
Composite primary key (shard key and sort key). |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot