tick_tack_techie
tick_tack_techie

Reputation: 429

How do disable the query-cache in DAX?

How do I disable query cache for AWS Dynamo DAX? The answer at Can we have infinite TTL for DAX item cache mentions setting the ttl to 0 would just make the query results to live ever till eviction.

Upvotes: 0

Views: 1664

Answers (1)

jackdbernier
jackdbernier

Reputation: 1572

If you need specific queries to be strongly consistent, DAX will honor that parameter if you pass it in the API call.

To perform a strongly consistent GetItem, BatchGetItem, Query, or Scan request, you set the ConsistentRead parameter to true. DAX passes strongly consistent read requests to DynamoDB.

Source https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.consistency.html#DAX.consistency.strongly-consistent-reads

The other possibility is to use 2 clients. The DAX one for queries that you want cached and the dynamodb one for queries that you need to bypass the cache. Since DAX implements the sam API as dynamodb, it shouldn’t be too hard to implement.

Upvotes: 2

Related Questions