Dynamodb hard
In a distributed environment, what is the isolation guarantee of a DynamoDB `TransactWriteItems` operation?
- A Read-Uncommitted: Changes are visible to other queries as soon as the first item is written.
- B Serializable Isolation: While a transaction is in progress, the items are essentially locked. Other requests see the data either as it was BEFORE the transaction or AFTER, but never in a partial ('dirty') state.
- C Eventual Isolation: Replication to GSIs is guaranteed but isolation across base items is 'best effort'.
- D Snapshot Isolation only within a single AWS Availability Zone.
Answer: B. Serializable Isolation: While a transaction is in progress, the items are essentially locked. Other requests see the data either as it was BEFORE the transaction or AFTER, but never in a partial ('dirty') state.
DynamoDB transactions provide ACID guarantees. The isolation level is 'Serializable', meaning concurrent transactions or individual reads/writes will see a consistent state. It accomplishes this via a multi-phase internal protocol that manages locks across distributed partitions, which is why it costs 2x the standard capacity units.
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?