partition key
The DynamoDB attribute whose value decides which storage partition an item lives in, and which every query must name.
In more detail
Items with the same partition key form an item collection, stored and read together. Choose a key with many distinct, evenly used values so traffic spreads across partitions instead of piling onto one.
Example
conversation_id -> shard for chat; tenant plus time bucket -> shard for metrics.Related terms
- DynamoDB sort key — An optional second part of a DynamoDB key that orders items sharing a partition key, so you can read a range of them.
- Amazon DynamoDB — Amazon's fully managed key-value and document database, which stores items in tables without any servers for you to run.
- hot partition — A partition that gets far more traffic than the others because many requests use the same key, causing throttling even when total capacity is free.
- partition — One slice of a larger dataset or message stream, owned and processed independently of the others.
- hot key — A single key that receives a large share of all traffic, such as a celebrity account or a popular event.
- compound key — A key built from two or more fields, such as tenant plus time bucket.
- locality — Keeping data close to the code or users that need it, to avoid slow trips across a network.
Taught in
- Database Performance: Caches, Proxies And Capacity Units — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- The Performance Clinic: Five Slow Systems, Five Fixes — AWS Certified Solutions Architect – Associate (SAA-C03) Exam Prep
- NoSQL and DynamoDB — Cloud Infrastructure & Hyperscaler Architecture
- Partitioning, Sharding And Hot Keys — Scalable System Design & Distributed Architecture
- The Difference Between A Queue And A Log — Scalable System Design & Distributed Architecture
- Worked Design One: Scaling The Ticket Booking System — Scalable System Design & Distributed Architecture
References
- DynamoDB partitions and data distribution
- Best practices for designing partition keys
- MongoDB manual: Shard keys