aws dynamodb读取容量查询

aws dynamodb read capacity query

根据DynamoDB ReadWriteCapacity

Units of Capacity required for writes = Number of item writes per second x item size in 1KB blocks

Units of Capacity required for reads* = Number of item reads per second x item size in 4KB blocks

  • If you use eventually consistent reads you’ll get twice the throughput in terms of reads per second.

If your items are less than 1KB in size, then each unit of Read Capacity will give you 1 strongly consistent read/second and each unit of Write Capacity will give you 1 write/second of capacity. For example, if your items are 512 bytes and you need to read 100 items per second from your table, then you need to provision 100 units of Read Capacity.

我对上面提到的 4kb 块和 1kb 示例感到困惑。 如果一个项目是 512 字节,它是否会四舍五入到 4kb,因此 1 个读取单元允许 1 个项目read/second?我假设 Item 将四舍五入为 1kb,因此 1 个读取容量导致读取 4 items/seconds(和 8 items/second,最终一致)。这个假设是否正确?

ceil() 是一个将非整数值四舍五入到下一个最大整数的函数。

  • 1 个写入单元允许您每秒写入 1 / ceil(item_size / 1kB) 项。

  • 1 个读取单位允许您每秒读取 1 / ceil(item_size / 4kB) 项。

因此,例如:

48 个写入容量单位允许 48 次写入 高达 1 kB 的项目,或 24 次写入超过 1kB 至 2kB 的项目,或 16 次写入超过 2kB 至高达 3kB 的项目等

48 个读取容量单位允许您读取 48 个项目高达 4kB,或 24 个超过 4kB 的项目高达 8kB。

如果项目超过相关操作的块大小,您不能超过您的订阅率,并且您只能做更少的事情。

If your items are less than 1KB in size, then each unit of Read Capacity will give you 1 strongly consistent read/second and each unit of Write Capacity will give you 1 write/second of capacity.

这是准确的,因为根据定义,<= 1kB(写入块大小)的项目也 =< 4kB(读取块大小)。