- Newest
- Most votes
- Most comments
When using global tables you shouldn't write to the same item in different regions at around the same time (within the replication window) unless you don't care the order in which the writes apply. One write is going to win, the other is going to lose. If both regions at around the same time increment an item's value by 1 the final value might be +1 or +2, depending on if there was a last writer wins conflict. So best not to try to do such things.
Furthermore, transactional writes are only ACID in the region where the transaction runs. The remote region will get the data replicated in once the transaction completes, but the items will replicate individually not as a unit. If you try to run a transaction on the remote region it may run against a partial view of the original transaction (half the items updated, half still replicating in) and will make all its conditional decisions against that torn transactional view.
Your example talks about using transactions but then talks about delays in the writes within one transaction. That's not how transactions work. You send the one request and either all work succeeds or all fails. Just remember that even if the work succeeds (and is ACID) the individual items replicate independently and the receiving end might will have a partial view as things replicate over.
Easiest approach is to route all writes for a given item (or all items) to one region at a time, so you're always working against the latest data.
Relevant content
- Accepted Answerasked 5 years ago
- Accepted Answerasked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 months ago