Global Tables: Multi-Region Replication
Global tables replicate a DynamoDB table to several AWS Regions, and every replica accepts reads and writes.
Introduction
Global tables replicate a DynamoDB table to several AWS Regions, and every replica accepts reads and writes. They give users low-latency local access and let you keep serving traffic if a Region is impaired. The key design question is what happens when the same item is written in two Regions at once.
Purpose of this lesson
You will add a replica Region, understand replication and conflict resolution, and design write routing that avoids conflicts.
Understanding the topic
How global tables behave:
- Each replica is a full table in its Region with the same key schema and indexes.
- In the default multi-Region eventual consistency mode, changes typically replicate within a second; concurrent writes to the same item are resolved with last writer wins.
- AWS also offers a multi-Region strong consistency mode with stricter Region-set requirements and higher write latency; check current Region support before designing around it.
- Transactions are atomic only in the Region where they run; other Regions receive the individual item changes.
- Streams are required for replication; each replica has its own stream.
- Replicated writes consume write capacity in every Region and incur cross-Region data transfer.
Internal architecture
Avoid conflicts by routing writes for an item to one Region:
- Give each customer a
homeRegionand send that customer's writes there; reads can go to the nearest replica. - For shared items (inventory counts), keep the authoritative writes in one Region or use per-Region counters summed on read.
- During a Region failure, move a customer's home Region deliberately — accept that the last few writes may still be replicating.
Syntax reference
Add a replica Region:
aws dynamodb update-table \--region us-east-1 \--table-name ShopTable \--replica-updates '[{"Create": {"RegionName": "eu-west-1"}}]'aws dynamodb describe-table --region us-east-1 --table-name ShopTable \--query "Table.Replicas[].{Region:RegionName,Status:ReplicaStatus}"
Output
[
{
"Region": "eu-west-1",
"Status": "ACTIVE"
}
]Best practices
- Design for single-Region writes per item even though every replica accepts writes.
- Monitor
ReplicationLatencyper replica pair. - Use on-demand or matching auto scaling in every Region so replicas are not throttled.
- Practise Region failover with traffic shifting before you need it.
Common mistakes
- Writing the same item concurrently from several Regions and losing updates to last-writer-wins.
- Assuming a transaction's atomicity holds across Regions.
- Forgetting the extra replicated write cost when budgeting.
Advanced interview questions
Interview Prep
Practice concise answers, then expand each card for the explanation.
1IntermediateQuestionHow does DynamoDB resolve conflicting writes in global tables?+
Answer
2AdvancedQuestionAre transactions ACID across Regions in a global table?+
Answer
Hands-on exercise
Hands-on (sandbox account): create a two-Region global table, write an item in Region A, and measure how long until a strongly consistent read in Region B returns it. Then write different values to the same item in both Regions within a second and observe which value survives.
Summary
Global tables give multi-Region, multi-writer replicas. Replication is fast but asynchronous by default, conflicts resolve with last writer wins, and good designs route each item's writes to one Region.