Obsidian

Search

Search IconIcon to open search

Provisioned Throughput

Last updated Jan 17, 2023

# What?

Provisioned throughput is a feature in DynamoDB that allows you to specify the amount of read and write capacity that you want to allocate to a table or a global secondary index.

There are two types of provisioned throughput:

Each read or write operation consumes one read or write capacity unit.

The total amount of read and write capacity units that you can consume per second is determined by the total number of read and write capacity units that you have provisioned for your table or index.

You can use Auto Scaling, which automatically adjusts the provisioned read and write capacity for a table based on the traffic. This ensures that your table always has the capacity to handle the traffic, even during sudden spikes in traffic.

DynamoDB calculates the consumed capacity units based on the size of the item being read or written, and the number of capacity units consumed per read or write operation may vary.

# Why?

Why Partitions in DynamoDB are affected by Provisioned Throughput?

Each Partitions in DynamoDB has a limited amount of read and write capacity. When you provision a table with a certain amount of read and write capacity, Dynamo distributes this capacity across the partitions in the table. The more capacity you provision for a table, the more items can be stored in a single partition.

For example, if you provision a table with 5 read capacity units and 2 write capacity units, DynamoDB will distribute these capacity units across the partitions in the table. Each partition will be able to handle up to 5 read operations per second and 2 write operations per second. If you increase the provisioned throughput, more items can be stored in a single partition and if you decrease it, fewer items can be stored in a single partition.

When you perform a query or a scan operation, DynamoDB uses the partition key value to determine which partition the requested data is stored in. Once the partition is identified, the query or scan is performed only on that partition, consuming the provisioned throughput from that partition. So if a partition is heavily loaded, it will consume more throughput.

It’s also worth mentioning that, the distribution of data across partitions is also affected by the partition key value. If you choose a partition key that has a high number of distinct values and that distributes the data evenly across all of the partitions, then the table will be able to handle a higher level of read and write traffic with less provisioned throughput.