Why Capacity Math Matters
DynamoDB pricing is based on throughput consumption, not query count. Miscalculating capacity requirements leads to either throttling (under-provisioned) or wasted spend (over-provisioned). Understanding the math lets you estimate costs before building and diagnose throttling issues in production.
Read Capacity Unit (RCU)
An RCU is the unit of read throughput. The rules:
| Read Type | Cost | Item Size Rounding |
|---|---|---|
| Strongly Consistent | 1 RCU per read | Round up to nearest 4 KB |
| Eventually Consistent | 0.5 RCU per read | Round up to nearest 4 KB |
| Transactional | 2 RCUs per read | Round up to nearest 4 KB |
Strong vs. Eventually Consistent: A strongly consistent read always returns the most recent data. An eventually consistent read may return stale data (typically milliseconds old) but costs half as much. For most read operations — displaying a product catalog, showing historical orders — eventual consistency is acceptable and halves your read costs.
Calculation examples:
Scenario 1: Read a 1 KB item, strongly consistent
→ Round 1 KB up to 4 KB (minimum unit)
→ 4 KB / 4 KB = 1 RCU
Scenario 2: Read a 10 KB item, strongly consistent
→ Round 10 KB up to 12 KB (next multiple of 4)
→ 12 KB / 4 KB = 3 RCUs
Scenario 3: Read a 10 KB item, eventually consistent
→ 3 RCUs × 0.5 = 1.5 RCUs
Scenario 4: Read a 10 KB item in a transaction
→ 3 RCUs × 2 = 6 RCUs
Write Capacity Unit (WCU)
A WCU is the unit of write throughput. The rules:
| Write Type | Cost | Item Size Rounding |
|---|---|---|
| Standard Write | 1 WCU per write | Round up to nearest 1 KB |
| Transactional Write | 2 WCUs per write | Round up to nearest 1 KB |
Note: Writes round to 1 KB increments (not 4 KB like reads). A 1.5 KB item costs 2 WCUs to write.
Calculation examples:
Scenario 1: Write a 0.5 KB item
→ Round up to 1 KB
→ 1 WCU
Scenario 2: Write a 3.2 KB item
→ Round up to 4 KB
→ 4 WCUs
Scenario 3: Write a 3.2 KB item in a transaction
→ 4 WCUs × 2 = 8 WCUs
Provisioned vs. On-Demand Mode
- Provisioned: You specify exact RCU and WCU values. You pay for what you provision, not what you use. Use Auto Scaling to adjust based on CloudWatch metrics. Best for predictable, steady-state workloads.
- On-Demand: DynamoDB scales automatically. You pay per request. Best for unpredictable or spiky workloads, or new applications where traffic patterns are unknown. On-demand is typically 6-7× more expensive per request than provisioned at sustained load.
The GSI capacity trap: Each GSI has its own independent capacity. If your base table has 1,000 WCUs but your GSI has only 100 WCUs, writes that update the GSI will throttle at 100 WCUs — even though the base table has plenty of capacity. Always provision GSI capacity proportionally to write patterns that touch GSI attributes.