DynamoDB 是否“设置"?重视 CDRT? [英] Are DynamoDB "set" values CDRTs?

查看:14
本文介绍了DynamoDB 是否“设置"?重视 CDRT?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

换一种说法如果 N >> 1 个客户端同时使用 updateItemADD— 不知何故仍低于规定的限制 —在下一次一致读取时,集合的大小是否始终为 10,000?

Stated differently if N >> 1 clients concurrently add 10,000 unique values to a DynamoDB "set" type using updateItem and ADD—somehow remaining under the provisioned limits—will the size of the set always be 10,000 on the next consistent read?

设置"我特指 Multi- 可附加在 DynamoDB 中的值数据类型.理论上,单调增长的集合是一个 CDRT,但文档中的任何地方都没有提到 DynamoDB 实现是否是 CDRT.它实际上根本不是很具体的安全性:

By "set" I refer specifically to the Multi-Valued Data Type that can be attached in DynamoDB. In theory, monotonically-growing sets are a CDRT, but whether the DynamoDB implementation is a CDRT is not mentioned anywhere in the documentation. It's not actually not very specific about safety at all:

ADD - 如果属性不存在,则将指定的值添加到项目.如果属性确实存在,那么 ADD 的行为取决于属性的数据类型:

ADD - Adds the specified value to the item, if the attribute does not already exist. If the attribute does exist, then the behavior of ADD depends on the data type of the attribute:

如果现有数据类型是一个集合,并且如果 Value 也是一个集合,则将 Value 附加到现有集合.例如,如果属性值为集合 [1,2],并且指定了 ADD 操作 3,那么最终的属性值为[1,2,3].如果为集合属性指定了 ADD 操作并且指定的属性类型与现有集合类型不匹配,则会发生错误.

If the existing data type is a set, and if Value is also a set, then Value is appended to the existing set. For example, if the attribute value is the set [1,2], and the ADD action specified 3, then the final attribute value is [1,2,3]. An error occurs if an ADD action is specified for a set attribute and the attribute type specified does not match the existing set type.

我已经对此进行了实验,除非我受到限制,否则我还没有产生任何丢失的添加,但我在文档中找不到这样的无损保证.事实上,除了条件更新"之外,我找不到任何关于任何数据类型的此类保证.

I have experimented with this and have yet to produce any lost additions unless I get throttled, but I cannot find such a lossless guarantee in the documentation. In fact, I cannot find any such guarantees about any data type except for "conditional updates".

推荐答案

是的,从集合中添加/删除也是原子的.

Yes, adding/removing from sets is also atomic.

http://aws.amazon.com/dynamodb/faqs/ 仅提及StringSet 但它也适用于其他集合类型.

http://aws.amazon.com/dynamodb/faqs/ only mentions StringSet but it applies to other set types as well.

问:DynamoDB 是否支持就地原子更新?

Q: Does DynamoDB support in-place atomic updates?

Amazon DynamoDB 支持快速就地更新.您可以使用单个 API 调用增加或减少一行中的数字属性.同样,您也可以原子地添加或删除一组字符串.

Amazon DynamoDB supports fast in-place updates. You can increment or decrement a numeric attribute in a row using a single API call. Similarly, you can add or remove to a set of strings atomically as well.

这篇关于DynamoDB 是否“设置"?重视 CDRT?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆