Dynamodb hard
To scale a global counter, an engineer uses 'Write Sharding' with 100 suffixes. What is the primary 'Latency' trade-off during a Read operation?
- A The read is instant because the data is distributed.
- B Scatter-Gather Ceiling: The total read latency is determined by the slowest of the 100 parallel requests (P99 tail latency). Additionally, you consume 100x the RCUs compared to reading a single item.
- C The read must wait for a global transaction lock on all 100 shards.
- D Reading sharded data is prohibited in the Free Tier.
Answer: B. Scatter-Gather Ceiling: The total read latency is determined by the slowest of the 100 parallel requests (P99 tail latency). Additionally, you consume 100x the RCUs compared to reading a single item.
This is the 'Fan-Out' penalty. You solved the 1,000 WCU write bottleneck by spreading it. But to get the total back, you must hit 100 partitions. If 1 partition is slightly slow, the whole aggregation is slow. This is why sharding factors should be kept as low as possible for the required throughput.
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?