Reputation: 687
Does DynamoDB charge for the read/write capacity Input I set-up for a table or, only for when I use them?
Upvotes: 3
Views: 1266
Reputation: 8285
This page in documentation answers your question pretty extensively.
Write capacity units are only consumed for writing and removing individual items:
The following describes how DynamoDB write operations consume write capacity units:
PutItem—writes a single item to a table. If an item with the same primary key exists in the table, the operation replaces the item. For calculating provisioned throughput consumption, the item size that matters is the larger of the two.
UpdateItem—modifies a single item in the table. DynamoDB considers the size of the item as it appears before and after the update. The provisioned throughput consumed reflects the larger of these item sizes.
DeleteItem—removes a single item from a table. The provisioned throughput consumption is based on the size of the deleted item.
BatchWriteItem—writes up to 25 items to one or more tables. For example, if BatchWriteItem writes a 500 byte item and a 3.5 KB item, DynamoDB will calculate the size as 5 KB (1 KB + 4 KB), not 4 KB (500 bytes + 3.5 KB).
RCUs are only consumed when you read elements from a table:
The following describes how DynamoDB read operations consume read capacity units:
GetItem—reads a single item from a table. For example, if you read an item that is 3.5 KB, DynamoDB rounds the item size to 4 KB. If you read an item of 10 KB, DynamoDB rounds the item size to 12 KB.
BatchGetItem—reads up to 100 items, from one or more tables. For example, if BatchGetItem reads a 1.5 KB item and a 6.5 KB item, DynamoDB will calculate the size as 12 KB (4 KB + 8 KB), not 8 KB (1.5 KB + 6.5 KB).
Query—reads multiple items that have the same partition key value. For example, suppose your query returns 10 items whose combined size is 40.8 KB. DynamoDB rounds the item size for the operation to 44 KB. If a query returns 1500 items of 64 bytes each, the cumulative size is 96 KB.
Scan—reads all of the items in a table. DynamoDB considers the size of the items that are evaluated, not the size of the items returned by the scan.
UPDATE
To make it clear. You pay money no matter how much of provisioned RCUs/WCUs you use, but you do not spend RCUs/WCUs on table creation/deletion.
Upvotes: 2