AWS DynamoDB RCUs Calculation for IoT Sensor Data Storage

AWS DynamoDB RCUs Calculation for IoT Sensor Data Storage

Prev Question Next Question

Question

You are working on a client application that uses DynamoDB as its database to store IoT sensor data.

The application is receiving ProvisionedThroughputExceededException too frequently for read requests.

The client has asked you to overcome this issue by adjusting RCUs.

The application receives 1200 eventual read requests every minute where each request is of 2.5KB.

How many RCUs does the application need to fulfill all the requests?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: A.

Option A is correct: 1 RCU provides two 4KB read per second for the eventual consistency model.

Items to read every second: 1200/60 = 20

To read one item, we need: 2.5/4 = 0.63, rounding off to the nearest whole number will be 1

Hence, we require 1 RCUs to read one item.

Total RCUs required: 1*20 = 20; 20/2 = 10, because eventual consistency model provides us 2 4KB read every second.

Option B, C and D are incorrect since they are not the required RCUs to overcome ProvisionedThroughputExceededException error.

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

DynamoDB is a highly scalable NoSQL database service offered by AWS. It provides a Provisioned Throughput capacity that allows you to specify the number of reads and writes per second that you need for your application.

In this scenario, the application is receiving a large number of read requests, and the application is experiencing a ProvisionedThroughputExceededException error. This error is thrown when the application is trying to read more data than the provisioned throughput capacity that is assigned to the table.

To overcome this issue, the client has asked you to adjust the Read Capacity Units (RCUs). An RCU is a unit of measurement for the amount of capacity that is assigned to read operations in DynamoDB. One RCU can read up to 4KB of data per second.

To calculate the RCUs required for your application, you need to calculate the amount of data that is being read per second. In this scenario, the application is receiving 1200 read requests every minute, and each request is of 2.5KB. Therefore, the total amount of data that is being read per second can be calculated as:

1200 requests/minute * 2.5KB/request * (1 minute/60 seconds) = 50 KB/second

To convert the amount of data into RCUs, you need to divide the amount of data by the maximum amount of data that one RCU can read per second, which is 4KB. Therefore, the RCUs required can be calculated as:

50 KB/second / 4KB/second = 12.5 RCUs

As DynamoDB only supports integers, you need to round up the RCUs to the nearest integer, which is 13 RCUs. However, none of the answer options provided match with 13, so the closest option is 11 (option B). Therefore, the correct answer is option B.