Process Flow - Partition key and sort key
Start: Insert Item
Extract Partition Key
Hash Partition Key
Find Partition
Check if Sort Key Exists?
No→Store Item in Partition
Yes
Sort Items in Partition by Sort Key
Store Item in Sorted Order
End
When adding data, DynamoDB uses the partition key to find the partition. If a sort key is present, it orders items within that partition by the sort key.