Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何禁用 AWS Dynamo DAX 的查询缓存?Can we have infinite TTL for DAX item cache的答案提到将 ttl 设置为 0 只会使查询结果一直存在直到被驱逐。
如果您需要特定查询保持强一致性,DAX 将在 API 调用中传递该参数时接受该参数。
要执行高度一致的 GetItem、BatchGetItem、Query 或 Scan 请求,请将 ConsistentRead 参数设置为 true。DAX 将高度一致的读取请求传递给 DynamoDB。
来源https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.consistency.html#DAX.consistency.strongly-consistent-reads
另一种可能性是使用 2 个客户端。DAX 用于您想要缓存的查询,而 dynamodb 用于您需要绕过缓存的查询。由于 DAX 将 sam API 实现为 dynamodb,因此实现起来应该不会太难。