gpt4 book ai didi

amazon-web-services - Dynamodb 缺少并发请求的更新?

转载 作者:行者123 更新时间:2023-12-04 09:30:51 25 4
gpt4 key购买 nike

我无法同时多次更新单个项目。如果我尝试像这样多次更新具有新属性的项目:

UpdateExpression: 'SET attribute.#uniqueId = :newAttribute'

并非所有更新都会通过。我尝试发送 20 个具有唯一 ID 的更新,结果只有 15 个新属性。这也发生在我的本地 dynamodb 实例中。我假设更新以某种方式在“最后更新获胜”的情况下相互覆盖,但我不确定。我该如何解决这个问题?

最佳答案

DynamoDB 在更新时最终是一致的,因此“竞争条件”是可能的。如果您想要更严格的写入逻辑,请查看 transactions

Items are not locked during a transaction. DynamoDB transactionsprovide serializable isolation. If an item is modified outside of atransaction while the transaction is in progress, the transaction iscanceled and an exception is thrown with details about which item oritems caused the exception.

关于amazon-web-services - Dynamodb 缺少并发请求的更新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62853684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com