Module Review: Core Concepts
In this module, we explored the foundational architecture of DynamoDB. We learned how data is distributed across partitions using Consistent Hashing, how throughput is provisioned via RCUs and WCUs, and the trade-offs between Eventual and Strong Consistency.
Key Takeaways
- Architecture: DynamoDB uses Consistent Hashing to distribute data across physical partitions based on your Partition Key.
- Scaling: Scaling is horizontal. Partitions split automatically when they exceed 10GB storage or throughput limits (~3k RCU / 1k WCU).
- Throughput:
- RCU: 1 read/sec for 4KB item (Strong). Eventual reads are half price (0.5 RCU).
- WCU: 1 write/sec for 1KB item.
- Consistency:
- Eventual (Default): Fast, high availability, potential for stale reads.
- Strong: Guaranteed latest data, higher latency, costs 2x.
- Pricing:
- Provisioned: Best for steady state.
- On-Demand: Best for unpredictable spikes.
Flashcards
RCU Unit Size
What is the item size limit for a single Read Capacity Unit?
4 KB
Items larger than 4KB consume multiple RCUs. For example, a 4.1KB item requires 2 RCUs.
Hot Partition
What causes a "Hot Partition"?
Low Cardinality Keys
Using a Partition Key with few unique values (e.g., "Status") forces all traffic to a single partition, causing throttling.
Eventual Consistency Cost
How much does an Eventually Consistent read cost compared to a Strong one?
50% (Half)
It consumes 0.5 RCU per 4KB, whereas Strong Consistency consumes 1.0 RCU.
Partition Key Role
What is the primary function of the Partition Key?
Distribution
It is hashed to determine the physical storage node (partition) where the data lives.
WCU Unit Size
What is the item size limit for a single Write Capacity Unit?
1 KB
Writes are more expensive per byte than reads. A 1.5KB write consumes 2 WCUs.
Throttling Exception
What exception is thrown when you exceed your capacity?
ProvisionedThroughputExceededException
You should handle this with Exponential Backoff and Jitter.
Cheat Sheet
| Mode | Reads (RCU) | Writes (WCU) | Consistency |
|---|---|---|---|
| Provisioned | /hour (Reserved) | /hour (Reserved) | Configurable |
| On-Demand | /request | /request | Configurable |
| Operation | Unit Cost (4KB Read / 1KB Write) |
|---|---|
| Eventual Read | 0.5 RCU |
| Strong Read | 1.0 RCU |
| Transactional Read | 2.0 RCU |
| Standard Write | 1.0 WCU |
| Transactional Write | 2.0 WCU |