Dynamodb hard
Why is it technically impossible to request a 'Strongly Consistent Read' on a Global Secondary Index (GSI)?
- A The AWS engineers haven't released the supporting SDK yet.
- B Asynchronous Log-Replication: GSIs are physically separate tables with their own partition schemes. Updates travel via an internal 'log-shipping' mechanism from the base table to the GSI partitions, creating a sub-second replication lag that prohibits synchronous quorum reads.
- C GSIs are stored on cheaper, slower storage that doesn't support the IOPS required for strong consistency.
- D It is a security restriction to prevent timing attacks.
Answer: B. Asynchronous Log-Replication: GSIs are physically separate tables with their own partition schemes. Updates travel via an internal 'log-shipping' mechanism from the base table to the GSI partitions, creating a sub-second replication lag that prohibits synchronous quorum reads.
This is a fundamental CAP theorem trade-off. To keep writes fast and independent, DynamoDB does not wait for the GSI to update before confirming a write. Because the GSI and Table live on different servers, they cannot share a single atomic lock. If you need strong consistency on an index, you MUST use an LSI.
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?