AWS DynamoDB BatchWriteItem - 写入容量单位 [英] AWS DynamoDB BatchWriteItem - Write Capacity Units

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

问题描述

在 BatchWriteItems 的情况下如何计算消耗的写入容量单位数?

How is the number consumed write capacity units calculated in case of BatchWriteItems?

例如如果我批量写入 25 个项目,每个项目的大小为 0.1 KB,该操作会消耗 25 个 WCU,还是 3 个 WCU?

E.g. If I batch write 25 items, each with the size of 0.1 KB, would the operation consume 25 WCUs, or 3 WCUs?

推荐答案

这里 是相关文档.根据以下描述,这将是 25 个 WCU.

Here is the relevant documentation. Based on the description below, it would be 25 WCUs.

BatchWriteItem — 将最多 25 个项目写入一个或多个表.DynamoDB 将批处理中的每个项目作为单独的 PutItem 或 DeleteItem 请求(不支持更新)进行处理.因此 DynamoDB 首先将每个项目的大小向上舍入到下一个 1 KB 边界,然后计算总大小.结果不一定与所有项目的总大小相同.例如,如果 BatchWriteItem 写入一个 500 字节的项目和一个 3.5 KB 的项目,DynamoDB 会将大小计算为 5 KB(1 KB + 4 KB),而不是 4 KB(500 字节 + 3.5 KB).

BatchWriteItem — Writes up to 25 items to one or more tables. DynamoDB processes each item in the batch as an individual PutItem or DeleteItem request (updates are not supported). So DynamoDB first rounds up the size of each item to the next 1 KB boundary, and then calculates the total size. The result is not necessarily the same as the total size of all the items. For example, if BatchWriteItem writes a 500 byte item and a 3.5 KB item, DynamoDB calculates the size as 5 KB (1 KB + 4 KB), not 4 KB (500 bytes + 3.5 KB).

这篇关于AWS DynamoDB BatchWriteItem - 写入容量单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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