Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS DynamoDB BatchWriteItem - Write Capacity Units

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

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?

like image 340
nagy.zsolt.hun Avatar asked Jan 10 '19 23:01

nagy.zsolt.hun


People also ask

What is write capacity units in DynamoDB?

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.

How many writes can DynamoDB handle?

Each partition on a DynamoDB table is subject to a hard limit of 1,000 write capacity units and 3,000 read capacity units. If the workload is unevenly distributed across partitions, or if the workload relies on short periods of time with high usage (a burst of read or write activity), the table might be throttled.

How does DynamoDB reserved capacity work?

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.


1 Answers

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

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

like image 124
nareddyt Avatar answered Oct 18 '22 20:10

nareddyt