Ravi Sir's Cards › AWS
Idempotent receipts
This revision card explains Idempotent receipts. It starts from the need that s3 can retry the same ObjectCreated event. Double email confuses users. It describes idempotent = doing the same work twice is safe. Key the DynamoDB receipt by object versionId or etag; skip if already sent. The how-to section notes putItem with condition attribute_not_exists(receiptId) or GetItem first; only then SendEmail. An example on the card is two deliveries of the same event , then one email, one DynamoDB row.
Read card text
What this card says
Why do we need it?
S3 can retry the same ObjectCreated event. Double email confuses users.
What is it?
Idempotent = doing the same work twice is safe. Key the DynamoDB receipt by object versionId or etag; skip if already sent.
How to do it
PutItem with condition attribute_not_exists(receiptId) or GetItem first; only then SendEmail.
attribute_not_exists
Example
Two deliveries of the same event → one email, one DynamoDB row.