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)
-
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.
-
Any changes to the provisioned capacity on the master table will also not result in an update in throughput capacity on the replica.
-
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.
-
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.
-
As long as the replica table and the master table have different names, both tables can exist in the same region.
-
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.
- heartin's blog
- Log in or register to post comments
Recent comments