Difference between Partition Key and Sort Key in Amazon DynamoDB

Difference between Partition Key and Sort Key in Amazon DynamoDB

Partition Key

Primary key for the table.

Should be unique if Sort Key is not used.

Sort Key

Secondary Primary key for the table.

Used for Composite key when used. Composite key is generated using Partition Key and Sort Key.

Note:

DynamoDB uses the partition key value as the input to an internal hash function even if Sort Key is used. The output of hash function determines the item stored location.

Leave a Reply