DynamoDB读/写容量说明 [英] DynamoDB read/write capacity explanation

查看:160
本文介绍了DynamoDB读/写容量说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下有关DynamoDB的读/写容量逻辑。我在这里 https://docs.aws看了他们的文档。 amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html
,我也用谷歌搜索了它们与数据库中的项目的关系,但我不理解它们的定义。

I want to ask regarding the read/write capacity logic from DynamoDB. I looked at their documentation here https://docs.aws.amazon.com/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读/写容量说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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