You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Choosing the right primary key is the single most important design decision in DynamoDB. This lesson explains how partition keys and sort keys work, how DynamoDB distributes data, and how to design keys that enable efficient access patterns.
DynamoDB uses partitioning to distribute data across multiple storage nodes:
Hash Function
│
┌────────────────┼────────────────┐
▼ ▼ ▼
Partition A Partition B Partition C
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Items │ │ Items │ │ Items │
│ sorted by │ │ sorted by │ │ sorted by │
│ sort key │ │ sort key │ │ sort key │
└──────────┘ └──────────┘ └──────────┘
Each partition can store up to 10 GB of data and handle 3,000 read capacity units (RCUs) and 1,000 write capacity units (WCUs).
The partition key (also called the hash key) determines data distribution:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.