Topic lessonTopic: DynamoDB key design and workload skew
Investigate hot keys in DynamoDB|Compare volume and skew
The same request count can create different local pressure. Compare synthetic tenant distributions and the cost of reading data back after sharding.
Compare synthetic tenant distributions and the cost of reading data back after sharding.
This exercise uses fictional evidence and makes no changes in a live environment.
Compare distributions at equal total load
Traffic concentrated on partition keys can increase local pressure. Splitting a key affects how applications read from the result.
- Total → DistributionFix the window
- Distribution → CandidateIdentify concentration
- Candidate → VerifyInclude read cost
- Total
- Match the measurement window
- Distribution
- Compare tenant traffic
- Candidate
- Spread writes across keys
- Verify
- Measure reads and writes again
1,000 synthetic writes in two distributions
| Scenario | Distribution | What to inspect |
|---|---|---|
| Typical | 100 each across 10 tenants | Control distribution |
| Concentrated | 900 for one tenant, 100 elsewhere | Inspect the most frequent key |
| Split | Distribute across four synthetic shards | Measure each shard |
| History read | Merge up to four shard responses | Verify order and pagination |
A split may require reading and merging several shards for a tenant history.
Evidence for the decision
Read the distribution Match the design's key to the granularity of the observed distribution.
Account for reads Verify shard selection, ordering, continuation and extra requests after splitting.
Verify actual pressure Check throttling reasons and resource scope to test whether skew explains the symptom.
Check your decision
Choose an option to see the result and explanation.
Check, then explain in your own words
- Measure distribution and causes.
- Define the candidate and read contract.
- Verify under comparable load.
Check your understanding: Should you always split keys when demand peaks?
Inspect the actual limit and quantify read impact first.
A split can introduce another operating cost.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
Scope and conditionsDistributing traffic across partition keys.
Used in this lessonCompare distributions at equal total load 1,000 synthetic writes in two distributions Evidence for the decision