简体   繁体   English

Dynamodb:是否会根据读取或写入容量删除计数?

[英]Dynamodb: does delete count against read or write capacity?

I haven't able to find documentation within Amazon on this: does anyone know if the delete operation counts against your read or write capacity? 我无法在亚马逊上找到这方面的文档:有人知道删除操作是否会影响您的读取或写入容量?

I had expected it would count as a "write", but the behavior I'm seeing in testing seems to indicate the opposite. 我曾预料到它会算作“写”,但我在测试中看到的行为似乎表明相反。 Can someone confirm this? 有人能证实吗?

Good question - while this doesn't seem to be specified explicitly, there are still two strong hints towards being counted as a write operation (as one would expect indeed): 好问题 - 虽然这似乎没有明确指出,但仍有两个强有力的暗示被计算为写操作(正如人们所期望的那样):

1) Section Time Series Data and Access Patterns within Provisioned Throughput Guidelines in Amazon DynamoDB addresses efficient deletion and refers to affected write throughput: 1) Amazon DynamoDB中的预配置吞吐量指南中的 时间序列数据和访问模式 部分解决了有效删除问题,并引用了受影响的写入吞吐量:

Deleting an entire table is significantly more efficient than removing items one-by-one, which essentially doubles the write throughput as you do as many delete operations as put operations. 删除整个表比逐个删除项目效率要高得多,这实际上使写入吞吐量翻了一倍,就像执行put操作一样多的删除操作。

2) Section Responses within the DeleteItem API lists the return value ConsumedCapacityUnits and refers to write capacity units: 2) DeleteItem API中的部分响应列出了返回值ConsumedCapacityUnits并引用写入容量单位:

The number of write capacity units consumed by the operation. 操作消耗的写入容量单位数。 This value shows the number applied toward your provisioned throughput. 此值显示应用于预配置吞吐量的数量。 For more information see Provisioned Throughput in Amazon DynamoDB . 有关更多信息,请参阅Amazon DynamoDB中的预配置吞吐量

Yes, it does . 是的,确实如此 The documentation clearly says: 文件清楚地说:

PutItem , UpdateItem , and DeleteItem allow conditional writes, where you specify an expression that must evaluate to true in order for the operation to succeed. PutItemUpdateItemDeleteItem允许条件写入,您可以在其中指定必须求值为true的表达式才能使操作成功。 If the expression evaluates to false, DynamoDB will still consume write capacity units from the table: 如果表达式的计算结果为false,则DynamoDB仍将使用表中的写入容量单位:

  • If the item exists, the number of write capacity units consumed depends on the size of the item. 如果该项目存在,则消耗的写入容量单位数取决于项目的大小。 (For example, a failed conditional write of a 1 KB item would consume one write capacity unit; if the item were twice that size, the failed conditional write would consume two write capacity units.) (例如,1 KB项目的有条件写入失败将占用一个写入容量单位;如果该项目是该大小的两倍,则失败的条件写入将消耗两个写入容量单位。)

  • If the item does not exist, DynamoDB will consume one write capacity unit. 如果该项不存在,DynamoDB将使用一个写入容量单位。

Source: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/CapacityUnitCalculations.html#ItemSizeCalculations.Writes 来源: http//docs.aws.amazon.com/amazondynamodb/latest/developerguide/CapacityUnitCalculations.html#ItemSizeCalculations.Writes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM