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 in the default MREC mode 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

You add a replica table by selecting a region in the console, and DynamoDB automatically replicates the existing data. In the default consistency mode, multi-Region eventual consistency (MREC), writes go to the local table in each region, and DynamoDB asynchronously replicates them to the other regions. When the same item is updated simultaneously in multiple regions under MREC, DynamoDB resolves the conflict by using the change with the latest internal timestamp on a per-item basis (last-writer-wins). 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 in MREC mode 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 the design makes Lambda triggers idempotent.

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 in the default MREC mode, and in multi-Region strong consistency (MRSC) mode each write is synchronously replicated to at least one other Region before the write returns a successful response, 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. You can use 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 can stay limited. You configure capacity independently per region and match it to 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 the partition key design avoids hot partitions. 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. In the default MREC mode, DynamoDB asynchronously replicates changes to the other replicas, typically within a second or less, and resolves conflicts with last-writer-wins. Reads come from local replicas, and the same setup supports both DR and globally low-latency access. Choose Aurora Global Database for relational models and ACID transactions, and Global Tables for key-value active-active configurations.

References (Official AWS Resources)

The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.

If this page and the official documentation disagree, treat the official documentation as authoritative.

Share