Skip to content

Can DynamoDB TTL behavior "break" @aws-lambda-powertools/idempotency? #1732

Answered by dreamorosi
HaaLeo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @HaaLeo, thank you for opening a question in our repository!

Even though it's true that DynamoDB doesn't necessarily evict items as soon as their TTL has expired, Powertools is able to handle this case and their presence in the table does not prevent the Idempotency utility to detect that the operation should be in fact processed.

When processing a new payload the Idempotency utility performs an optimistic write and tries to save the record as "in progress". The write operation uses a condition expression that includes the following statements (source):

  • The attributes doesn't exist (this is a never-seen-before request or request whose record has already been evicted)
  • The item exists, …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@HaaLeo
Comment options

Answer selected by HaaLeo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants