Whereas tens of hundreds of shoppers are efficiently utilizing Amazon DynamoDB world tables with eventual consistency, we’re seeing rising wants for even stronger resilience. Many organizations discover that the DynamoDB multi-Availability Zone structure and ultimately constant world tables meet their necessities, however crucial purposes like fee processing methods and monetary companies demand extra.
For these purposes, clients require a zero Restoration Level Goal (RPO) throughout uncommon Area-wide occasions, that means you possibly can direct your app to learn the newest information from any Area. Your multi-Area purposes all the time have to entry the identical information no matter location.
Beginning in the present day, you need to use a brand new Amazon DynamoDB world tables functionality that gives multi-Area sturdy consistency (MRSC), enabling zero RPO. This functionality, first introduced as a preview at AWS re:Invent 2024, simplifies constructing extremely resilient world purposes.
Right here’s how one can allow MRSC beginning with an current empty DynamoDB desk:

With MRSC, DynamoDB now presents you the best stage of resilience on your purposes. If software processing is interrupted in a Area, you possibly can redirect site visitors to a different Area containing a MRSC duplicate and know that you simply’ll be processing the newest information.
Getting began
Let me stroll you thru how you need to use this new functionality.
To begin utilizing MRSC, I have to create a world desk from an current DynamoDB desk that doesn’t include any information. I navigate to my current desk, choose the International tables tab and choose Create duplicate.

The MRSC availability structure requires three AWS Areas. I can configure MRSC with both three full replicas or with two replicas and a witness. A witness comprises solely replicated change information to supply the required availability with out sustaining a full copy of my desk information.
The next screenshot reveals how I configure MRSC with two replicas and a witness. To configure MRSC with three full replicas as a substitute, I can clear Configure Area 2 as Witness.

If I have to replace my current desk programmatically, I can use the Amazon Q CLI to generate the required command with the next immediate:
> Hey Q! Replace my current DynamoDB desk referred to as "demo-mrsc" in us-east-1 with multi-Area sturdy consistency throughout us-east-2 with witness in us-west-2 Areas
Shortly after, Q CLI will reply again with following command:
> To replace your DynamoDB desk with multi-Area sturdy consistency, you may want to make use of the update-table command with the suitable parameters. Here is how you'll do it:
aws dynamodb update-table
--table-name demo-mrsc
--replica-updates '[{"Create": {"RegionName": "us-east-2"}}]'
--global-table-witness-updates '[{"Create": {"RegionName": "us-west-2"}}]'
--multi-region-consistency STRONG
--region us-east-1
After it’s completed processing, I can examine the standing of my MRSC world desk. I can see I’ve a witness configured for my DynamoDB world desk. A witness reduces prices whereas nonetheless offering the resilience advantages of multi-Area sturdy consistency.

Then, in my software, I can use ConsistentRead to learn information with sturdy consistency. Right here’s a Python instance:
import boto3
# Configure the DynamoDB shopper on your area
dynamodb = boto3.useful resource('dynamodb', region_name="us-east-2")
desk = dynamodb.Desk('demo-mrsc')
pk_id = "demo#test123"
# Learn with sturdy consistency throughout areas
response = desk.get_item(
Key={
'PK': pk_id
},
ConsistentRead=True
)
print(response)
For operations that require the strongest resilience, I can use ConsistentRead=True. For much less crucial operations the place eventual consistency is suitable, I can omit this parameter to enhance efficiency and cut back prices.
Further issues to know
Listed below are a few issues to notice:
- Availability – The Amazon DynamoDB multi-Area sturdy consistency functionality is on the market in following AWS Areas: US East (Ohio, N. Virginia), US West (Oregon), Asia Pacific (Osaka, Seoul, Tokyo), and Europe (Frankfurt, Eire, London, Paris)
- Pricing – Multi-Area sturdy consistency pricing follows the present world tables pricing construction. DynamoDB not too long ago lowered world tables pricing by as much as 67 %, making this extremely resilient structure extra reasonably priced than ever. Go to Amazon DynamoDB lowers pricing for on-demand throughput and world tables within the AWS Database Weblog to study extra.
Study extra about how one can obtain the best stage of software resilience, allow your purposes to be all the time out there and all the time learn the newest information whatever the Area by visiting Amazon DynamoDB world tables.
Glad constructing!
— Donnie
