2
votes

How does DynamoDB handle TransactionalWrite on the same item in a Global Table over different regions.

Example scenario: I have a global table in us-east-1 (N.Virginia) and us-east-2 (Ohio) regions. I have distributed system which does a transactional write operation on an item. There can be a scenario where the same transaction write operation is done on a global database across multiple region.

How would the data propagation in this case for the global streams work. How would the atomicity be maintained in this case?

1

1 Answers

0
votes

Transactional operations provide ACID guarantees only within the region where the write is made originally. Transactions are not supported across regions in global tables. For example, if you have a global table with replicas in the US East (Ohio) and US West (Oregon) regions and perform a TransactWriteItems operation in the US East (N. Virginia) Region, you may observe partially completed transactions in US West (Oregon) Region as changes are replicated. Changes will only be replicated to other regions once they have been committed in the source region.

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html#transaction-integration


Also, Global Tables use timestamp to resolve conflicts. So, if two different writes happen to same item in us-east-1 and us-east-2, then the latest written value will be persisted.