Lesson 4 of 6 Amazon DynamoDB

Replicating DynamoDB Tables Across Regions with Global Tables

This lesson explains how global tables replicate a DynamoDB table across Regions with every replica accepting reads and writes, for globally distributed applications and multi-Region resilience.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how global tables replicate changes.
  • Identify the uses of global tables.

How global tables work

DynamoDB global tables provide fully managed, multi-active replication across Regions: applications read and write locally in every Region, and changes are replicated to the others, typically in under a second. This gives users low latency wherever they are and allows the application to keep running if a Region becomes unavailable.

When the same item is updated in two Regions at nearly the same time, the conflict is resolved by last writer wins. For applications that need it, the optional multi-Region strong consistency mode lets reads see the latest write from any Region. Replicas can be added to an existing table at any time.

The following diagram shows a global table with replicas in three Regions.

DynamoDB global tables. Applications in each Region read and write their local replica, and changes are replicated to the other Regions, typically in under a second. Concurrent updates to the same item are resolved by last writer wins, unless the multi-Region strong consistency mode is used.
The Regions are illustrative. Every replica accepts writes, which is what makes global tables multi-active.
True or false

Global tables

Exam skills 2.2.2 · 3.3.2

Check how DynamoDB global tables work.

Log in to try this activity Interactive activities are free with an account.

Uses

A global table replicates a DynamoDB table to several Regions, and every replica accepts reads and writes. This serves three requirements. Users worldwide get low latency, because they read and write in the nearest Region. Disaster recovery is fast, because data is already in the other Regions: changes typically replicate within about a second, and recovery means only redirecting traffic. Active-active architectures become possible, with every Region serving traffic all the time. The following table summarises these uses.

RequirementBenefit
Low-latency access for users worldwideReads and writes in the nearest Region
Multi-Region disaster recoveryAn RPO of about a second and an RTO limited to redirecting traffic
Active-active architecturesEvery Region serves traffic all the time

Applications should route each user to one Region at a time, for example with Route 53 latency routing, to avoid conflicting concurrent writes.

Worked example

A global leaderboard

A mobile game has players in Europe, North America and Asia. Each needs low-latency reads and writes, and the leaderboard is read thousands of times a second.

RequirementFeature
Low-latency reads and writes in three RegionsGlobal tables with replicas in each Region
Microsecond reads of hot itemsDAX in each Region
Send a notification when a player reaches the top 10DynamoDB Streams with a Lambda function
Recover from a bad deployment that corrupted scoresPoint-in-time recovery

Global tables are multi-active: every Region accepts writes and replicates them, usually within a second. That is the standard answer for a globally distributed, serverless NoSQL database.

Check yourself

What do global tables provide?

Show answer

Replicas of a table in several Regions that all accept reads and writes, so users get local latency and the application can keep working if a Region fails.

Exam Tips

Remember for the exam

  • For multi-Region active-active replication with local writes, use global tables.
  • Global tables resolve conflicts with last writer wins, unless multi-Region strong consistency is used.
  • For a DynamoDB disaster recovery copy with an RPO of about a second, use global tables.