DynamoDB为同一记录生成多个INSERT事件。

huangapple go评论70阅读模式
英文:

DynamoDB generates multiple INSERT events for the same record

问题

我弄清楚了,记录被删除然后重新创建,我以为它只是被更新了。

英文:

There is a Lambda that processes INSERT events received from a DynamoDB table stream, the table has a single attribute HASH, let's say RecordId.

Now once a record is created and quickly after updated by PutItem command, it generates multiple INSERT events though the following events should UPDATE events.

BTW, if it could be related, the record have a 24-hour later ttl attribute.

Also, I cannot reproduce this, I am just concluding it based on the Lambda execution logs.

ANSWER:
figured it out, the record was deleted and re-created, I though it was just updated.

答案1

得分: 0

DynamoDB Streams 提供了事件的确切一次传递,没有重复。但是,话虽如此,您的 Lambda 函数可以自由地重试事件两次,这会在执行日志中显示两次。从本质上讲,由您来确保您的 Lambda 函数是幂等的。

英文:

DynamoDB streams provides you exactly once delivery of an event, there are no duplicates. But, with that said you Lambda is free to retry an event twice which would show it twice in your execution logs. In essence, it's up to you to ensure your Lambda function is idempotent.

答案2

得分: 0

弄清楚了,记录已被删除并重新创建,我原以为只是更新了。

英文:

Figured it out, the record was deleted and re-created, I though it was just updated.

huangapple
  • 本文由 发表于 2023年6月2日 07:12:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76386257.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定