DynamoDB读/写容量说明

编程入门 行业动态 更新时间:2024-10-09 17:24:18
本文介绍了DynamoDB读/写容量说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想问一下有关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读/写容量说明

本文发布于:2023-11-28 08:00:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641577.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:容量   DynamoDB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!