本文介绍了DynamoDB 条件写入是否强一致?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设给定的表已经包含以下键值对:
Suppose that a given table already contains the following key value pair:
"abc" => { i: 1, v: "foo" }
"abc" => { i: 1, v: "foo" }
然后,两个客户端发出冲突的并发条件写入.客户端 1 写道:
Then, two clients issue conflicting concurrent conditional writes. Client 1 writes:
"abc" => { i: 2, v: "bar1" } 如果 i == 1
"abc" => { i: 2, v: "bar1" } if i == 1
客户端 2 写道:
"abc" => { i: 2, v: "bar2" } 如果 i == 1
"abc" => { i: 2, v: "bar2" } if i == 1
那么,能保证最多一个客户端的写操作成功吗?
Then, is it guaranteed that an most one client's write operation will succeed?
推荐答案
是的,这正是他们设计的用例.您可以在 文档 中查看示例.
Yes, that's exactly the use case they're designed for. You can see an example in the docs.
这篇关于DynamoDB 条件写入是否强一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!