我想问一下有关DynamoDB的读/写容量逻辑。我在这里 docs.aws看了他们的文档。 amazon/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html ,我也用谷歌搜索了它们与数据库中的项目的关系,但我不理解它们的定义。
I want to ask regarding the read/write capacity logic from DynamoDB. I looked at their documentation here docs.aws.amazon/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html and I also googled how they are related to the items in the db but I don't understand their definition.
因此,在我的情况下,
我有一个像这样的表哈希键,称为 user_id 和名为 flag_key
I have a table like this Hash key called user_id and sort key called flag_key
每个项目都像此 {user_id:'user-1',flag_key:'refresh_token',flag_value:'some-random-refresh-token'} 或 {user_id:'user-1',flag_key:'roles',flag_value:['role-a','role-b']}
以及其他与上述类似的东西。
and other things similar to the above.
现在,如果我要查询3件事,例如刷新令牌,角色和 login_history
Now if I want to query 3 things e.g. refresh_token, roles, and login_history
我将查询dynamoDB 3次。
I would query the dynamoDB 3 times.
所以我的问题是,
DynamoDB是否向我收取3个读取容量?即使合并的项目少于4KB?
does DynamoDB charge me 3 read capacity for that? Even though the combined items are less than 4KB?
推荐答案是的,如果您进行3个不同的查询,则将至少使用3个RCU
Yes, if you make 3 different queries, you will use 3 RCU minimum.
但是,由于要检索同一分区键的项目,因此可以使用单个查询操作。只要您进行单个查询,它就会返回您需要的所有数据,并且这些数据总共少于4KB,您将只使用1个RCU(读取容量单位)。
However, since you are retrieving items for the same partition key, you may use a single query operation. As long as you make a single query and it returns all the data you need and that data is less than 4KB in total you will only use 1 RCU (read capacity unit).
更多推荐
DynamoDB读/写容量说明
发布评论