Global tables and multi-Region

Amazon DynamoDB · Expert · 14 min

Global tables give low-latency local access worldwide and Region-level resilience, but change your consistency model.

A global table is a set of replica tables in several AWS Regions that DynamoDB keeps in sync. Every replica accepts reads and writes (multi-active), so users in each Region get local latency and an application can fail over by sending traffic to another Region.

With the default multi-Region eventual consistency (MREC), a write is acknowledged in its own Region and replicated to the others asynchronously, typically within a second. If the same item is written in two Regions concurrently, conflicts are resolved by last writer wins on timestamps: one write silently disappears. Designs therefore often route each item's writes to a single "home" Region, or make writes commutative.

Global tables can alternatively be configured for multi-Region strong consistency (MRSC), across three Regions, where a write is synchronously replicated and strongly consistent reads in any Region see the latest value, at the cost of higher write latency and some feature restrictions. Check the current docs for supported Regions and limitations.

Other points:

  • conditional writes and transactions evaluate in the local Region only (transactions are not atomic across Regions under MREC)
  • replicated writes consume write capacity in every Region
  • TTL and streams work per replica; a TTL deletion replicates like any delete

Plan failover with Route 53 or application routing, and test it.

Remember

  • Replicas in several Regions, all read/write
  • MREC: async replication, last writer wins on conflicts
  • MRSC: synchronous, strongly consistent across Regions with higher latency
  • Transactions and conditions are Region-local; writes are paid in every Region

Watch out for

  • Allowing the same item to be updated from several Regions under MREC and losing updates to last-writer-wins.

Check yourself

  1. Under eventual-consistency global tables, two Regions update the same item at the same time. What happens?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html

Builds on

Unlocks

Nothing builds on this yet.