Dynamodb hard
A developer performs a standard `PutItem` for an item that is exactly 2,049 bytes in size. How many Write Capacity Units (WCUs) are consumed?
- A 2 WCUs
- B 3 WCUs: Consumption is calculated in 1KB blocks, and anything exceeding a block boundary is rounded UP to the nearest integer.
- C 2.05 WCUs (DynamoDB supports fractional capacity charges).
- D 1 WCU (Standard PutItems are capped at 1 WCU unless they exceed 4KB).
Answer: B. 3 WCUs: Consumption is calculated in 1KB blocks, and anything exceeding a block boundary is rounded UP to the nearest integer.
The math is: `Ceiling(Size / 1KB)`. For a 2,049-byte item: `2,049 / 1,024 = 2.000976...` which rounds up to 3 WCUs. Understanding these boundaries is critical for cost-optimizing large JSON payloads (e.g., trying to stay just under the 2,048-byte mark to save 33% on writes).
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- DynamoDB has a strict 400KB limit on the size of a single item. What is the recommended design pattern if you need to store larger documents (e.g., 5MB PDFs)?
- What is the primary role of the 'Partition Key' in ensuring DynamoDB's infinite horizontal scalability?
- Why is the `Query` operation generally preferred over `Scan` for production workloads in DynamoDB?
- DynamoDB is a 'fully managed' serverless database. What is a primary operational benefit of this model for an engineering team?
- In 'Provisioned Capacity' mode, how is the performance budget of a DynamoDB table defined?
- When would an architect choose to implement DAX (DynamoDB Accelerator) in front of an existing DynamoDB table?