AWS DynamoDB Read Capacity for Strong Consistency - Best Practices

Read Capacity for Strong Consistency in DynamoDB - Recommendations

Prev Question Next Question

Question

An application is being designed to make use of DynamoDB.

As per the requirements, the application will read the DynamoDB items of 6 KB of size per second.

The number of requests per second is estimated to be around 10

If strong consistency is required, what should be the read capacity set for the table?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Answer - C.

The calculation of throughput capacity for the table would be as follows.

Since 6KB's is the item size, we need to consider it in chunks of 4KB.

Hence that would be 2.

Since there are around 10 requests per second, that means = 2*10=20.

Since it's required at a strong consistency level, the read capacity would be 20.

Based on the calculations, all other options are incorrect.

For more information on DynamoDB throughput, please refer to the below URL-

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ProvisionedThroughput.html

To determine the read capacity required for the DynamoDB table to satisfy the given requirements, we need to consider the following:

  • Item size: 6 KB
  • Read requests per second: 10
  • Strong consistency required

For strongly consistent reads, DynamoDB returns a response with the most up-to-date data, reflecting all writes that received a successful response prior to the read. Strongly consistent reads require more capacity compared to eventually consistent reads, which return a response with the latest data that is usually a few seconds behind the actual write.

The formula to calculate the read capacity required for strongly consistent reads is:

Required read capacity = (item size / 4 KB) * (read requests per second)

Note that DynamoDB measures throughput capacity in terms of read capacity units (RCUs) and write capacity units (WCUs). One RCU represents one strongly consistent read per second, or two eventually consistent reads per second, of an item up to 4 KB in size.

Using the formula above, we can calculate the required read capacity:

Required read capacity = (6 KB / 4 KB) * 10 Required read capacity = 15

This means that we need a read capacity of 15 RCUs to satisfy the given requirements.

From the available answer options, the closest match to the required read capacity is option C, which is 20. Option D, which is 40, is twice the required read capacity and therefore not necessary. Option A, which is 5, is too low and would not meet the application's requirements. Option B, which is 10, is the same as the estimated read requests per second and does not take into account the item size, so it is also too low.

Therefore, the correct answer is option C, which is 20.