DynamoDB ClientRequestToken 8-hour TTL: handling retries after token expiry
0 reputation · 26 Mar 2023, 09:38 UTC
0 reputation · 26 Mar 2023, 09:38 UTC
DynamoDB stores a ClientRequestToken for PutItem, UpdateItem, and DeleteItem operations for up to 8 hours. Within that window, retries with the same token return the original response without re-executing the write. After the token is purged, a retry with the same token executes as a new write, which can create duplicate items or overwrite attributes if the original write succeeded but the response was lost.
The service does not expose a configuration to extend the token TTL, and the token store is not inspectable. Conditional writes using ConditionExpression can provide longer-term deduplication, but they require the caller to know the expected attribute state — information that may be unavailable after a network partition or client crash. TransactWriteItems does not accept ClientRequestToken at all, so transaction idempotency must be implemented at the application layer. Global Tables add another dimension: tokens are not replicated across regions, so cross-region retries can still produce divergent writes.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.