Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 878
Clayton Avatar asked Feb 21 '12 22:02

Clayton


People also ask

How does DynamoDB determine read and write capacity?

One write capacity unit represents one write per second for an item up to 1 KB in size. If you need to write an item that is larger than 1 KB, DynamoDB must consume additional write capacity units. Transactional write requests require 2 write capacity units to perform one write per second for items up to 1 KB.

When you reserve capacity in DynamoDB What does it apply to?

Reserved capacity is a billing feature that allows you to obtain discounts on your provisioned DynamoDB throughput capacity in exchange for a one-time up-front payment and commitment to a certain usage level. DynamoDB reserved capacity applies to a specific AWS region and can be purchased with 1-year or 3-year terms.

What is DynamoDB write capacity?

A write capacity unit represents one write per second, for an item up to 1 KB in size. For example, suppose that you create a table with 10 write capacity units. This allows you to perform 10 writes per second, for items up to 1 KB in size per second. Item sizes for writes are rounded up to the next 1 KB multiple.


2 Answers

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:

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.

2) Section Responses within the DeleteItem API lists the return value ConsumedCapacityUnits and refers to write capacity units:

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.

like image 69
Steffen Opel Avatar answered Oct 10 '22 09:10

Steffen Opel


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. If the expression evaluates to false, DynamoDB will still consume write capacity units from the table:

  • 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.)

  • If the item does not exist, DynamoDB will consume one write capacity unit.

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

like image 39
albogdano Avatar answered Oct 10 '22 11:10

albogdano