AWS Dynamo Rollback超时

发布于 2025-02-10 01:59:48 字数 231 浏览 1 评论 0原文

如果我的AWS lambda写信给Dynamo,暂停后会回滚吗?

两个方案的:

  1. 我一次更新交易中的DB?

  2. 我发送了包裹在交易中的批处理更新(以25个记录为单位)?

我认为,由于每个批处理更新和每个更新都是原子事务,因此不会回滚。

如果Lambda Times在记录99上发布,我该如何回头说出100个记录的更新?

If i have AWS lambda that writes to Dynamo, will it rollback after a timeout?

Two scenario's:

  1. I update the dB in a transaction one item at a time?

  2. I send a batch update (chunked at 25 records) wrapped in a transaction ?

I think that since each batch update and each single update is an atomic transaction, it will not rollback.

How can i roll back say update of 100 records if the lambda times out on record 99?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赢得她心 2025-02-17 01:59:48

如果您在更新记录时担心Lambda超时,请减少每个Lambda调用更新的项目数量,以便给您足够的净空。您可以将需要更新的所有项目键发送到SQS队列中,然后从队列中提取第二个Lambda并更新一批记录。如果您的lambda执行时间在任何批次记录中都会出现,则SQS消息将返回队列,可以再次处理。

If you are worried about a lambda timeout when updating records, reduce the number of items each lambda invocation updates to give yourself plenty of headroom. You can send all item keys needing an update into an SQS queue, then have a second lambda pull from the queue and update a batch of records. If your lambda execution times out on any batch of records, the SQS message will be returned to the queue and it can be processed again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文