Question

Difficulty: HardData Store Operations with Amazon DynamoDB

A developer is building a backend service for an IoT-based smart agricultural monitoring system. The system receives real-time telemetry from 500500 sensor nodes deployed in the field. Each sensor node publishes status updates containing soil moisture and temperature readings. The serialized payload size for each status update is 2.2 KB2.2\text{ KB}, and the application receives and writes 150150 status updates per second directly to an Amazon DynamoDB table. A management dashboard displays a summary of the last 1010 telemetry updates for a specific sensor node by making 55 requests per second using eventually consistent reads. Which two of the following actions should the developer perform to design the database and client access layer efficiently?

  1. Provision 450450 Write Capacity Units (WCUs) for the table to handle the sensor telemetry ingestion.Answer
  2. Query the table using a KeyConditionExpression on the sensor ID partition key, and provision 1515 Read Capacity Units (RCUs) to support the dashboard workload.Answer
  3. C
    Scan the table using a FilterExpression on the sensor ID, and provision 1515 Read Capacity Units (RCUs) to retrieve the dashboard telemetry.
  4. D
    Initialize the Amazon DynamoDB client in the application by hardcoding the AWS Access Key ID and Secret Access Key of a dedicated IAM user to bypass IAM role evaluation latency.
  5. E
    Provision 330330 Write Capacity Units (WCUs) for the table, calculating the write capacity as 150 writes/sec×2.2 KB150\text{ writes/sec} \times 2.2\text{ KB} without rounding up individual items.

Answer

Provision 450450 Write Capacity Units (WCUs) for the table and query the table using a KeyConditionExpression on the sensor ID partition key, provisioning 1515 Read Capacity Units (RCUs).
The correct options are the ones recommending provisioning 450450 WCUs for table writes and using the Query API with 1515 RCUs. For the write capacity, 150150 updates per second at 2.2 KB2.2\text{ KB} (rounded up to 3 KB3\text{ KB} per item) requires 450450 WCUs. For the read capacity, querying 1010 items totaling 22 KB22\text{ KB} (rounded up to 24 KB24\text{ KB}) at 55 eventually consistent queries per second requires 1515 RCUs (24 KB/4 KB×0.5×5=1524\text{ KB} / 4\text{ KB} \times 0.5 \times 5 = 15).

Step-by-Step Solution

1
Calculate the Write Capacity Units (WCUs) needed for ingestion.
Each update is 2.2 KB2.2\text{ KB}, which rounds up to 3 KB3\text{ KB} per item. Writing 150150 updates per second requires 150×3=450 WCUs150 \times 3 = 450\text{ WCUs}.
DynamoDB rounds up write payloads to the nearest 1 KB1\text{ KB} increment, and each standard write consumes 1 WCU1\text{ WCU} per 1 KB1\text{ KB} per second.
2
Calculate the Read Capacity Units (RCUs) needed for the dashboard queries.
The query retrieves 1010 items of 2.2 KB2.2\text{ KB} each, totaling 22 KB22\text{ KB}. This rounds up to the next 4 KB4\text{ KB} boundary, which is 24 KB24\text{ KB}. A single query consumes 24 KB/4 KB=6 RCUs24\text{ KB} / 4\text{ KB} = 6\text{ RCUs} for strongly consistent reads, or 3 RCUs3\text{ RCUs} for eventually consistent reads. At 55 queries per second, this requires 3×5=15 RCUs3 \times 5 = 15\text{ RCUs}.
Query operations sum the total size of all returned items and round up to the next 4 KB4\text{ KB} boundary. Eventually consistent reads consume 0.5 RCU0.5\text{ RCU} per 4 KB4\text{ KB} block.
3
Determine the optimal access API and security pattern.
Use the Query API instead of Scan to target specific partition keys, and use the default credential provider chain rather than hardcoded credentials.
Querying minimizes RCU consumption by scanning only the targeted partition, and using IAM roles ensures secure AWS SDK client configuration.

Key Concept

Calculating DynamoDB read and write capacity units for item-level writes and Query operations under specific consistency models, combined with secure client initialization.
Rate this question