hello123
hello123

Reputation: 391

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.

Upvotes: 5

Views: 5697

Answers (3)

Amjath Sharief
Amjath Sharief

Reputation: 78

This has been the consistent problem with AWS service teams. They seems to design things in isolation without worrying about the different related context. I have seen this kind of inconsistency in design at several places. In fact even with in DAX and DynamoDB the 2 TTL concepts doesn’t consider its functions even though they are related. Don’t know when AWS service teams will design things with full context like Microsoft does for their solutions.

Upvotes: 0

notionquest
notionquest

Reputation: 39186

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.

Upvotes: 6

NoSQLKnowHow
NoSQLKnowHow

Reputation: 4855

At this time, the DAX cache in region two will have no knowledge of the GT replicated write. Your best alternative at the moment is to keep a lower TTL on DAX in both regions, so it fetches the newest version more often.

Upvotes: 3

Related Questions