amazon-dynamodb-developer-guide
amazon-dynamodb-developer-guide copied to clipboard
partition keys do need to be have a large number of distinct values relative to the number of items in the table
The following example from the documentation seems to suggest that partition keys do not need to be have a large number of distinct values relative to the number of items in the table:
"Suppose that the Pets table has a composite primary key consisting of AnimalType (partition key) and Name (sort key)."
I think using the Name
as a partition key would be a better, more correct example given the following Amazon recommendation:
"DynamoDB is optimized for uniform distribution of items across a table's partitions, no matter how many partitions there may be. We recommend that you choose a partition key that can have a large number of distinct values relative to the number of items in the table."
I suggest that the example is updated to use Name
as a partition key and AnimalType
as a sort key to help developers designing better solutions.