17 January,2025 by Rambler
AWS announced the preview of Global DynamoDB Multi-Region Strong Consistency .Eventual Consistency is the default - but a new option is available to use case requiring mult-region active\active transaction processing.
At this point the Strong Consistency is not in GA , but it is available in the following regions as a Preview
US East (N. Virginia) – us-east-1
US East (Ohio) – us-east-2
US West (Oregon) – us-west-2
Setting up is straightforward
--Create a new on-demand, single-Region table named mrscTest in the us-east-2 Region.
aws dynamodb create-table --table-name mrscTest --attribute-definitions AttributeName=TestAtt1,AttributeType=S AttributeName=TestAtt2,AttributeType=S --key-schema AttributeName=TestAtt1,KeyType=HASH AttributeName=TestAtt2,KeyType=RANGE --billing-mode PAY_PER_REQUEST --region us-east-1
aws dynamodb describe-table --table-name mrscTest --region us-east-1
--Add two new replica tables to the single-Region table in the remaining supported Regions for preview by specifying the multi-region-consistency parameter to STRONG.
aws dynamodb update-table --table-name mrscTest --replica-updates "[{\"Create\": {\"RegionName\": \"us-west-2\"}}, {\"Create\": {\"RegionName\": \"us-east-2\"}}]" --multi-region-consistency STRONG --region us-east-1
--If you only request one replica you'll get this error. 3 replicas are required
An error occurred (ValidationException) when calling the UpdateTable operation: Unsupported table replica count for global tables with MultiRegionConsistency set to STRONG.
One of the behavioural differences from Multi-Region Eventual Consistency tables is "You must create an MRSC global table by adding two replica tables to an existing single-Region table that doesn't contain any data". So how does this work for Restoring? It doesn't work .
If you restore a GlobalDynamoDB with data and then attempt to add the 2 replicas necessary to restore back to the Global DynamoDB MRSC state
aws dynamodb update-table --table-name mrscTest-restore --multi-region-consistency STRONG --replica-updates "[{\"Create\": {\"RegionName\": \"us-west-2\"}},{\"Create\": {\"RegionName\": \"us-east-2\"}}]" --region us-east-1
An error occurred (ValidationException) when calling the UpdateTable operation: Regional table cannot contain data when creating a global table with MultiRegionConsistency set to STRONG.
As mentioned in the following official document, you need to make sure that the table is an existing single-Region table and it doesn't contain any data.
----------------
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/multi-region-strong-consistency-gt.html#mrsc-preview-considerations
----------------
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |