Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does invalidation work in AWS DynamoDB DAX multi-region

We are using DynamoDB global tables and planning to use DAX on the top of DynamoDB to enable caching. But I don't see any mention of how DAX invalidation will take place in multi-region setup.

For example, let's say there are 2 clusters, one in us-west-2 and one in us-east-2. If we update something in us-east-2 using the DAX client it's cache will be updated but while replicating the data to us-west-2, will global table update cache in us-west-2 as well? I don't see any mention of this in the DynamoDB documentation.

like image 399
hello123 Avatar asked Mar 05 '23 09:03

hello123


1 Answers

The DAX cache will not be updated. Global tables will replicate the data in other regions. However, it wouldn't update the cache. Even, the query cache and item cache are independent.

DAX does not refresh result sets in the query cache with the most current data from DynamoDB. Each result set in the query cache is current as of the time that the Query or Scan operation was performed. Thus, Charlie's Query results do not reflect his PutItem operation. This will be the case until DAX evicts the result set from the query cache.

Write through policy:-

The DAX item cache implements a write-through policy (see How DAX Processes Writes). When you write an item, DAX ensures that the cached item is synchronized with the item as it exists in DynamoDB. This is helpful for applications that need to re-read an item immediately after writing it. However, if other applications write directly to a DynamoDB table, the item in the DAX item cache will no longer be in sync with DynamoDB.

DAX Consistency

In the above statement, you can consider the other application word as global table replication. The DAX wouldn't aware about the replication done for the global table.

like image 178
notionquest Avatar answered Mar 29 '23 23:03

notionquest