For my table, I have the attributes:
- ItemId
- ProductName
Only ItemId + ProductName is unique. However ItemId has very high cardinality and is virtually unique, just not guaranteed. ProductName has very low cardinality (~5 different values). Client will always pass in ItemId + ProductName to get the item.
Approach 1
Originally I was thinking of setting (simple) primary key's partition key to ItemId + ProductName (string concat).
Approach 2
However, since primary key cannot be changed after table is created, I'm thinking of keeping the sort key as a placeholder. So setting (composite) primary key's partition key to ItemId and sort key to ProductName.
The benefit is in case I want to add things to the sort key in the future (like version number), I can do it without migrating table. Though right now I don't see what I would add.
But are there any downsides (such as performance) with Approach 2 as-is (sort key being low cardinality), compared to Approach 1?