![]() |
While tens of thousands of customers successfully use Global Amazon Dynamodb tables with eventual consistency, we see the emerging needs for strong resistance. Many organizations find that the architecture of the zone of more Dynamodb real estate and eventually consists of global tables that meet their requirements, critical applications, such as payment and financial processing systems, demanded more.
For these applications, customers require an objective point of zero recovery (RPO) during rare events throughout the region, which means you can direct your application to read the latest data from any region. Your application for multiple regions must always access the same rental data appearance.
From this day, you can use the new Amazon Dynamodb Global Table, which provides a strong consistency of multi-regions (MRSC), allowing zero RPO. This ability, which was first announced as a preview of AWS Re: Invent 2024, simplifies building highly durable global applications.
Here’s how you can enable MRSC starting with an existing empty table Dynamodb:
With MRSC, Dynamodb now offers you the highest resistance level for your applications. If application processing is interrupted in the region, you can redirect traffic to another area containing a MRSC replica and know that you will process the latest data.
We are starting
Let me go through you how you can use this new ability.
In order to start using MRSC, I have to create a global table from an existing Dynodb table that contains no data. I go to my existing table, select Global tables Card and select Create a replica.
Architecture of MRSC availability requires three AWS regions. I can configure MRSC with either three complete replicas or two replicas and witnesses. The witness contains only replicated data to provide the required availability without maintaining a complete copy of my table data.
The following screenshot shows how I configure MRSC with two replicas and witnesses. To configure the MRSC with three complete replications instead, I can clean up Configuration of Area 2 as a Witness.
If I need to update my current program program, I can use the Amazon Q Cli to generate the desired command using the following prompt:
> Hey Q! Update my existing DynamoDB table called "demo-mrsc" in us-east-1 with multi-Region strong consistency across us-east-2 with witness in us-west-2 Regions
Shortly thereafter, Q CLS will react back with the following command:
> To update your DynamoDB table with multi-Region strong consistency, you'll need to use the update-table command with the appropriate parameters. Here's how you would 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
Upon completion of processing, I can check the condition of my MRSC Global table. I see that I have witness Configured for my global Dynamodb table. The witness reduces costs and at the same time provides the benefits of resistance of strong consistency.
Then in my application I can use ConsistentRead
Reading data with a strong consistency. Here’s an example of Python:
import boto3
# Configure the DynamoDB client for your region
dynamodb = boto3.resource('dynamodb', region_name="us-east-2")
table = dynamodb.Table('demo-mrsc')
pk_id = "demo#test123"
# Read with strong consistency across regions
response = table.get_item(
Key={
'PK': pk_id
},
ConsistentRead=True
)
print(response)
For operations that require the strongest resistance, I can use ConsistentRead=True
. For less critical operations where possible consistency is acceptable, I can omit this parameter for improvisation of performance and reduce costs.
Other things to know
Here are a few things that you can note:
- Availability -Amazon Dynamodb Multi-Reg strong consistency is available in the following AWS regions: US EAST (Ohio, N. Virginia), US West (Oregon), Asia Pacific (Osaka, Seoul, Tokyo) and Europe (Frankfurt, Iregon, London, Paris)
- Prices -Mult-Reg The strong price of consistency monitors the current structure of global tables. Dynamodb recently reduced global table prices by up to 67 percent, making this highly resistant architecture more affordable than ever. Visit Amazon Dynamodb reduces prices for throughput on request and global tables in the AWS database blog and learn more.
Further information on how you can achieve the highest level of application resistance, allow your applications to always be Avaibles and always read the latest data regardless of the Amazon Dynodb global tables.
Happy building!
– Donnie