Building Multi-Region Databases with DynamoDB Global Tables - Active-Active Replication
Achieve low-latency reads and writes with multi-region active-active replication. Learn about conflict resolution mechanisms and DR design.
Overview of Global Tables
Global Tables is a multi-region database that replicates DynamoDB tables across multiple regions. While Aurora Global Database uses a leader/writer configuration, Global Tables provides an active-active setup where all regions can perform both reads and writes. Version 2019.11.21 (V2) allows replica tables to have the same features as regular DynamoDB tables, including local secondary indexes and on-demand capacity mode. Replicas can be added or removed without stopping writes to the table.
Replication and DR
Adding a replica table is as simple as selecting a region from the console, and existing data is automatically replicated. Writes are executed against the local table in each region and asynchronously replicated to other regions. When the same item is updated simultaneously in multiple regions, it is automatically resolved using last-writer-wins (the write with the most recent timestamp takes precedence). For DR design, Route 53 health checks and failover automatically switch to the secondary region when the primary region experiences an outage. Failover RTO depends on replication lag (typically under 1 second) and DNS TTL, so setting TTL to 60 seconds or less shortens switchover time.
Conflict Resolution and Best Practices
Global Tables uses Last Writer Wins conflict resolution, where the write with the most recent timestamp takes precedence. When concurrent writes to the same item occur, implement optimistic locking (conditional writes with version numbers) on the application side to detect conflicts. Replication latency between replicas is typically under 1 second but depends on the distance between regions. Streams in Global Tables are processed independently at each replica, so designing Lambda triggers for idempotency is critical. For a deeper understanding of multi-region design and operations, specialized books (Amazon) are a great resource.
Comparison with Aurora Global Database
Both Global Tables and Aurora Global Database provide multi-region configurations, but their architectures and use cases differ. Global Tables is active-active with all regions writable, while Aurora Global Database uses a read-replica configuration where only the primary region accepts writes. Global Tables replication is asynchronous with eventual consistency, whereas Aurora supports write forwarding from secondaries through the primary (with added latency). From a data model perspective, DynamoDB provides key-value and document models, while Aurora offers relational SQL. Choose Global Tables for low-latency key-value access with globally active-active writes, and Aurora Global Database for complex SQL queries and ACID transactions. Failover times differ as well: Global Tables depends on replication lag plus DNS TTL, while Aurora requires tens of seconds for promotion.
Pricing and Limits
Replicated writes in Global Tables are charged at the same WCU/WRU rate as regular writes. In a two-region configuration, write costs roughly double. Data transfer for replication is free. Reads are served from the local replica in each region, so no additional read costs are incurred. For workloads with few writes and many reads, the cost increase from Global Tables is minimal. Configure capacity independently per region and optimize based on traffic patterns. There are no table size limits or item count restrictions, but individual items must be 400 KB or less. Uneven partition key design can bottleneck replication throughput, so avoiding hot partitions is critical. Global secondary indexes (GSIs) are also replicated across regions, so GSI write costs are incurred in each region.
Summary
Global Tables provides active-active multi-region DynamoDB. It synchronizes data across regions with replication latency under 1 second and maintains consistency through last-writer-wins conflict resolution. Reads are served from local replicas, keeping additional costs minimal, while simultaneously delivering DR capabilities and globally low-latency access. Choose Aurora Global Database for relational models and ACID transactions, and Global Tables for key-value active-active configurations.