Database Reference
In-Depth Information
Provisioned throughput
Provisioned throughput is a special feature of DynamoDB that allows us to have consistent
and predictable performance. We need to specify the read and write capacity units. A read
capacity unit is one strongly consistent read and two eventually consistent reads per second
unit for an item as large as 4 KB, whereas one write capacity unit is one strongly consistent
write unit for an item as large as 1 KB. A consistent read reflects all successful writes prior
to that read request, whereas a consistent write updates all replications of a given data ob-
ject so that a read on this object after this write will always reflect the same value.
For items whose size is more than 4 KB, the required read capacity units are calculated by
summing it up to the next closest multiple of 4. For example, if we want to read an item
whose size is 11 KB, then the number of read capacity units required is three, as the nearest
multiple of 4 to 11 is 12. So, 12/4 = 3 is the required number of read capacity units.
Required Capacity Units For
Consistency
Formula
Reads
Strongly consistent No. of Item reads per second * Item Size
Reads
Eventually consistent Number of Item reads per second * Item Size/2
Writes
NA
Number of Item writes per second * Item Size
If our application exceeds the maximum provisioned throughput for a given table, then we
get notified with a proper exception. We can also monitor the provisioned and actual
throughput from the AWS management console, which will give us the exact idea of our
application behavior. To understand it better, let's take an example. Suppose, we have set
the write capacity units to 100 for a certain table and if your application starts writing to the
table by 1,500 capacity units, then DynamoDB allows the first 1,000 writes and throttles
the rest. As all DynamoDB operations work as RESTful services, it gives the error code
400 (Bad Request).
If you have items smaller than 4 KB, even then it will consider it to be a single read capa-
city unit. We cannot group together multiple items smaller than 4 KB into a single read ca-
pacity unit. For instance, if your item size is 3 KB and if you want to read 50 items per
second, then you need to provision 50 read capacity units in a table definition for strong
consistency and 25 read capacity units for eventual consistency.
Search WWH ::




Custom Search