Menu
Amazon DynamoDB
Developer Guide (API Version 2012-08-10)

Requirements and Best Practices

Using DynamoDB global tables, you can replicate your table data across AWS Regions. It is important that each replica table and secondary index in your global table has identical write capacity settings to ensure proper replication of data.

Requirements for Adding a New Replica Table

If you want to add a new replica table to a global table, each of the following conditions must be true:

  • The table must have the same partition key as all of the other replicas.

  • The table must have the same name as all of the other replicas.

  • The table must have DynamoDB Streams enabled, with the stream containing both the new and the old images of the item.

  • None of the replica tables in the global table can contain any data.

If global secondary indexes are specified, then the following conditions must also be met:

  • The global secondary indexes must have the same name.

  • The global secondary indexes must have the same partition key and sort key (if present).

Important

Write capacity settings should be set consistently across your replica tables and secondary indexes. DynamoDB strongly recommends enabling auto scaling to manage the write capacity settings for all of your global tables replicas and indexes.

If you prefer to manage write capacity settings manually, you should provision equal replicated write capacity units to your replica tables. You should also provision equal replicated write capacity units to matching secondary indexes across your global table.

You must also have appropriate IAM permissions. For more information, see Using IAM with Global Tables.

Best Practices and Requirements for Managing Capacity

Use DynamoDB Auto Scaling (Recommended)

Using DynamoDB auto scaling is the recommended way to manage throughput capacity settings for replica tables. DynamoDB auto scaling automatically adjusts read capacity units (RCUs) and/or write capacity units (WCUs) for each replica table based upon your actual application workload. For more information, see Managing Throughput Capacity Automatically with DynamoDB Auto Scaling.

If you create your replica tables using the AWS Management Console, then auto scaling will be enabled by default for each replica table, with default auto scaling settings for managing RCUs and WCUs.

If you decide to modify the auto scaling settings on one replica table or secondary index, then you must also apply the same auto scaling settings on all of the other replica tables and matching global secondary indexes. This ensures that there are enough write capacity units provisioned to each replica table and secondary index for table data replication.

Manually Managing Capacity

If you decide not to use DynamoDB auto scaling, then you must manually set the read capacity and write capacity settings on each replica table and secondary index.

The provisioned replicated write capacity units (rWCUs) on every replica table should be set to the total number of rWCUs needed for application writes across all regions multiplied by two. This will accommodate application writes that occur in the local region and replicated application writes coming from other regions. For example, if you expect 5 writes per second to your replica table in Ohio and 5 writes per second to your replica table in N.Virginia, then you should provision 20 WCUs to each replica table (5 + 5 = 10; 10 x 2 = 20).

To update the write capacity units for a global table programatically, you can use the UpdateGlobalTableSettings call. For more information, see Amazon DynamoDB API Reference.

Note

To update the settings (UpdateGlobalTableSettings) for a global table in DynamoDB, you must have the dynamodb:UpdateGlobalTable and dynamodb:DescribeLimits permissions. For more information, see Using IAM with Global Tables.