Amazon DynamoDB global tables

Why Amazon DynamoDB global tables?

Amazon DynamoDB global tables is a fully managed, serverless, multi-Region, and multi-active database. Global tables provide you 99.999% availability, increased application resiliency, and improved business continuity. As global tables replicate your Amazon DynamoDB tables automatically across your choice of AWS Regions, you can achieve fast, local read and write performance.

In the rare event of a single Region failure, there is no need for a database failover as global tables’ multi-active architecture allows customers to read and write to any replica table. Global tables also eliminate the difficult work of replicating data between Regions and resolving update conflicts for multi-active workloads. In addition, global tables enable your applications to stay highly available even in the rare event of isolation or degradation of an entire Region.

You can configure global tables in the AWS Management Console with the AWS Command Line Interface (AWS CLI) or with AWS CloudFormation. No application changes are required when reading or writing to a global table as global tables use the same DynamoDB APIs as single-Region tables.

There are no upfront costs or commitments to use global tables, and you pay only for the resources you use. Learn more about configuring global tables in the Amazon DynamoDB Developer Guide. For more information about global tables pricing, see Amazon DynamoDB pricing options for on-demand and provisioned.

How it works

A DynamoDB global table is comprised of multiple replica tables. Each replica table exists in a different Region, but all replicas have the same name and primary key. When data is written to any replica table, DynamoDB automatically replicates that data to all other replica tables in the global table .

For example, suppose that your application serves a large customer base spread across three geographic areas—the US East Coast, Canada, and Western Europe. Without global tables, you would have to create a table in each AWS Region and write code to replicate data changes across each table in each Region.

With global tables, you can create a global table with a replica table in the three Regions closest to each geographic area. DynamoDB will automatically replicate changes from any replica to the replicas in the other Regions.

Global tables enable the users of your application to have low-latency access to the data no matter where they are located. In the unlikely event that one AWS Region were to become temporarily unavailable, your customers can still access the replica tables in the other Regions.

How it works

Benefits of Amazon DynamoDB global table

Global tables are designed for 99.999% availability. If a single Region becomes isolated or degraded, your application can redirect to a different Region and perform reads and writes against a different replica table. You can apply custom business logic to determine when to redirect requests to other Regions. 

In addition, Amazon DynamoDB keeps track of any writes that have been performed but have not yet been propagated to all the replica tables. When the Region comes back online, Amazon DynamoDB resumes propagating any pending writes from that Region to the replica tables in other Regions and the other way around.

Global tables eliminate the complexity and operational burden of deploying and managing multi-active, multi-Region replication in Amazon DynamoDB. You can select the Regions where you need your data replicated and DynamoDB handles the rest. Applications access global tables by using existing DynamoDB APIs and endpoints.

Multi-active, multi-Region replication ensures that updates performed on a replica table in one Region are replicated to the replica tables in other Regions. Replication between table replicas across Regions is eventually consistent. This means that local reads and writes to replica tables within the same Region as the application can achieve strong consistency. However, the reads to items that are in other replica tables within a Region are eventually consistent.

Any changes made to any item in any replica table are replicated to all the other replicas within the same global table. In a global table, a newly written item is typically propagated to all replica tables within a second.  With a global table, each replica table stores the same set of data items. Amazon DynamoDB does not support partial replication of only some of the items. If applications update the same item in different Regions at about the same time, conflicts can arise.

To resolve conflicts, Amazon DynamoDB global tables use a last-writer-wins reconciliation between concurrent updates, in which Amazon DynamoDB makes the best effort to determine the last writer. With this conflict resolution mechanism, all replicas agree on the latest update and converge toward a state in which they all have identical data.

Global tables enable you to read and write your data locally, providing single-digit millisecond latency for your globally distributed application at any scale. This can boost the performance for massively scaled global applications.

Page topics

General

General

A global table is a collection of one or more replica tables, all owned by a single AWS account. A single Amazon DynamoDB global table can only have one replica table per AWS Region.

A replica table is a single DynamoDB table. Each replica table stores the same set of data items, has the same table name, and the same primary key schema. When an application writes data to a replica table in one Region, Amazon DynamoDB automatically replicates the writes to other replica tables in the other AWS Regions.

Yes, Amazon Dynamo global tables bolsters business continuity as it increases an application’s resiliency and provides strong consistency for a single Region. As global tables is multi-active, an application can read or write to any replica table. In the rare case of an unplanned Region event, the application can redirect to another replica.

You can create a global table using Amazon DynamoDB console, AWS CLI, or AWS CloudFormation with this step-by-step guide.

Prior to adding an additional replica in a different region to an Amazon DynamoDB global tables, the table must have DynamoDB Streams enabled, have the same name as all other replicas, have the same partition key as all other replicas, and have the same write capacity settings specified.

All replica tables in an Amazon DynamoDB global table must have the same name.

Similar to other databases, Amazon DynamoDB stores data in tables. A table is a collection of items, and each item is a collection of attributes. Amazon DynamoDB uses primary keys to uniquely identify each item in a table and has secondary indexes to provide more querying flexibility.

In contrast, an Amazon DynamoDB global table is a collection of one or more replica tables owned by a single AWS account. Each replica table is structurally the same as a regular Amazon DynamoDB table.

Yes, you can enable point-in-time recovery on each replica of a global table.

  • Zoom

    When the COVID-19 pandemic began, there was an enormous demand for our voice and video services. In early 2020, we saw unprecedented usage grow from 10M to 300M Daily Meeting Participants from new and existing customers that needed to connect virtually. On the backend, we were able to manage this surge with Amazon DynamoDB for Zoom Meetings. Using DynamoDB global tables in conjunction with on-demand mode enabled us to scale nearly infinitely with no performance issues, even with our sudden spike in usage.

    Yasin Mohammed, Engineering Manager, Cloud Operations at Zoom Video Communications, Inc.
  • Disney

    Disney+ uses Amazon DynamoDB to ingest content, metadata, and billions of customer actions each day, which enables viewers to add content to their Watch Lists, start watching a video and pick it up on a different device, and get recommendations for what to watch next.

    Billions of bookmarks ingested a day over Amazon Kinesis and into Amazon DynamoDB.

    Attilio Giue, Director of Content Discovery, Disney+
    Read the press release »
  • Snap Inc.

    Snap Inc. saved significantly on annual infrastructure costs and enabled a fast, reliable infrastructure for multimedia messaging app Snapchat by using Amazon DynamoDB.

    The capabilities Amazon DynamoDB offers and the continued innovation within it give us confidence that we can continue relying on it and innovating on top of it.

    Saral Jain, Director of Engineering and Head of Infrastructure, Snap Inc.
    Read the case study »