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.
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.
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.
Global Tables Pricing
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.
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.