How many read capacity units does a DynamoDB read use for strongly and eventually consistent reads?
One RCU covers one strongly consistent read per second of an item up to 4 KB, or two eventually consistent reads. Larger items are rounded up to the next 4 KB.
Explain it simply
Think of a petrol pump that gives fuel in 4-litre measures. If you need 6 litres you still pay for two measures. A strongly consistent read pays full price per measure; an eventually consistent read gets a half-price discount.
Example
Item size 6 KB, 10 reads per second
Strongly consistent
6 KB / 4 KB = 1.5 -> rounded up to 2 RCU per read
10 reads x 2 = 20 RCU
Eventually consistent (half the cost)
20 / 2 = 10 RCU
Transactional reads (2x strong)
10 reads x 2 x 2 = 40 RCUStrongly consistent reads return the latest committed write but use more capacity and have slightly higher latency. Eventually consistent reads may return data that is a moment old but are cheaper. By default GetItem, Query and Scan are eventually consistent, and you opt into strong consistency per request.
GSIs support only eventually consistent reads. For writes, one WCU covers a 1 KB item per second, again rounded up.
What to say in the interview
"One RCU is one strongly consistent read per second of up to 4 KB, or two eventually consistent ones, with item size rounded up to the next 4 KB. So a 6 KB item at 10 strong reads per second needs 20 RCU, and 10 if eventual consistency is acceptable."
Common mistakes
- Forgetting to round the item size up.