Doing DynamoDB Cross-Region Replication

Cross-region replication currently supports single master mode. A single master has one master table and one or more replica tables. There are no limits on the number of replicas.

A DynamoDB Streams reader is created for each replica table and copies data from the master table, keeping the replicas in sync.

 

Enabling DynamoDB Cross-region Replication

DynamoDB cross-region replication is enabled using the DynamoDB Cross-region Replication Library. The cross-region replication application is hosted in an EC2 instance in the same region where the cross-region replication application was originally launched.

Currently, AWS will not auto scale this EC2 instance based on demand, but will fail over to another instance in case of failure. The application underneath uses the Kinesis Client Library (KCL), which checkpoints the copy (to resume from there later).

Your table will remain available for reads and writes while the read replica is being created. The bootstrapping uses the Scan operation to copy from the source table and once completed, state of the replication changes from Bootstrapping to Active. AWS recommend to provision sufficient read capacity units to support this Scan operation.

AWS recommend that you provision at least the same write capacity as the master table to ensure that it has enough capacity to handle all incoming writes. Read capacity of replica table can be set appropriate for your application.

 

Important Points (Exam Tips)

  1. The secondary indexes on the master table will NOT be automatically created on the replica table and changes made on secondary indices on the master table are not replicated too.

  2. Any changes to the provisioned capacity on the master table will also not result in an update in throughput capacity on the replica.

  3. Consistency model: DynamoDB will acknowledge a write operation once it has been accepted by the master table. The write will then be propagated to each replica asynchronously. There will be a slight delay before a write has been propagated to all replica tables.

  4. CloudWatch metrics are available for every replication configuration (under Monitoring tab of replication group). You can monitor for any discrepancies between the master and replica tables.

  5. As long as the replica table and the master table have different names, both tables can exist in the same region.

  6. You can add or delete a replica from that replication group at any time. Deleting the replication group will delete the EC2 instance for the group.

Learn Serverless from Serverless Programming Cookbook

Contact

Please first use the contact form or facebook page messaging to connect.

Offline Contact
We currently connect locally for discussions and sessions at Bangalore, India. Please follow us on our facebook page for details.
WhatsApp (Primary): (+91) 7411174113
Phone (Escalations): (+91) 7411174114

Business newsletter

Complete the form below, and we'll send you an e-mail every now and again with all the latest news.

About

CloudMaterials is my blog to share notes and learning materials on Cloud and Data Analytics. My current focus is on Microsoft Azure and Amazon Web Services (AWS).

I like to write and I try to document what I learn to share with others. I believe that knowledge is useless unless you share it; the more you share, the more you learn.

Recent comments

Photo Stream