Question

Difficulty: Very hardData Store Operations with Amazon DynamoDB

A developer is designing a real-time inventory management microservice that uses an Amazon DynamoDB table. The application needs to support the following operations during peak traffic:

* 1010 `TransactWriteItems` operations per second. Each transaction contains two write actions: one writes a new item of 3.5 KB3.5\text{ KB}, and another updates an existing item resulting in a final size of 1.5 KB1.5\text{ KB}.
* 1515 standard `PutItem` operations per second, with an average item size of 4.5 KB4.5\text{ KB}.
* 4040 `TransactGetItems` operations per second. Each transaction reads a single item of 6 KB6\text{ KB}.

To ensure optimal performance, scalability, and security under the AWS shared responsibility model, which capacity provisioning and development strategy should the developer implement?

  1. Provision 195195 Write Capacity Units (WCUs) and 160160 Read Capacity Units (RCUs). Configure the application to use the default credential provider chain and retrieve items using Query or TransactGetItems operations instead of Scan.Answer
  2. B
    Provision 135135 Write Capacity Units (WCUs) and 8080 Read Capacity Units (RCUs). Retrieve items using TransactGetItems operations, and initialize the DynamoDB client by passing hardcoded IAM access keys directly into the SDK constructor.
  3. C
    Provision 195195 Write Capacity Units (WCUs) and 480480 Read Capacity Units (RCUs). To prevent partition hotness and optimize downstream processing, replace single-item query operations with parallel Scan operations that periodically read the entire table.
  4. D
    Provision 168168 Write Capacity Units (WCUs) and 160160 Read Capacity Units (RCUs). If the application encounters a ProvisionedThroughputExceededException, immediately configure DynamoDB Auto Scaling to scale up provisioned capacity to resolve the error.

Answer

Provision 195195 Write Capacity Units (WCUs) and 160160 Read Capacity Units (RCUs). Configure the application to use the default credential provider chain and retrieve items using Query or TransactGetItems operations instead of Scan.
The correct strategy provisions 195195 WCUs and 160160 RCUs, uses the default credential provider chain for secure authentication, and retrieves specific items efficiently via Query or TransactGetItems instead of Scan. The Write Capacity Unit (WCU) calculation is as follows: The TransactWriteItems workload consists of 1010 operations/second. Each operation has two write actions: a new item of 3.5 KB3.5\text{ KB} (rounded up to 4 KB4\text{ KB}, costing 4 WCUs×24\text{ WCUs} \times 2 for transactional writes = 8 WCUs8\text{ WCUs}) and an update resulting in a 1.5 KB1.5\text{ KB} item (rounded up to 2 KB2\text{ KB}, costing 2 WCUs×22\text{ WCUs} \times 2 for transactional writes = 4 WCUs4\text{ WCUs}). This totals 12 WCUs12\text{ WCUs} per transaction, or 120 WCUs120\text{ WCUs} for 1010 transactions/second. The standard PutItem workload consists of 1515 operations/second of 4.5 KB4.5\text{ KB} (rounded up to 5 KB5\text{ KB}, costing 5 WCUs5\text{ WCUs}). This consumes 75 WCUs75\text{ WCUs}. Summing these values gives 195 WCUs195\text{ WCUs}. The Read Capacity Unit (RCU) calculation is as follows: The TransactGetItems workload consists of 4040 operations/second. Each transaction reads one 6 KB6\text{ KB} item (rounded up to the nearest 4 KB4\text{ KB} boundary, which is 8 KB8\text{ KB}, consuming 2 RCUs2\text{ RCUs}). Since transactional reads consume double the RCUs of strongly consistent reads, each transaction costs 4 RCUs4\text{ RCUs}, totaling 160 RCUs160\text{ RCUs} for 4040 operations/second.

Step-by-Step Solution

1
Calculate the Write Capacity Units (WCUs) required for the 1010 TransactWriteItems operations per second.
120120 WCUs
Each transaction contains two write actions. Action 1 (3.5 KB3.5\text{ KB}) is rounded up to 4 KB4\text{ KB} and multiplied by 22 for transaction writes, yielding 8 WCUs8\text{ WCUs}. Action 2 (1.5 KB1.5\text{ KB}) is rounded up to 2 KB2\text{ KB} and multiplied by 22, yielding 4 WCUs4\text{ WCUs}. Total per transaction is 12 WCUs12\text{ WCUs}. For 10 operations/sec10\text{ operations/sec}, this consumes 10×12=120 WCUs10 \times 12 = 120\text{ WCUs}.
2
Calculate the WCUs required for the 1515 standard PutItem operations per second.
7575 WCUs
Each standard write of 4.5 KB4.5\text{ KB} is rounded up to 5 KB5\text{ KB} and consumes 5 WCUs5\text{ WCUs}. For 15 operations/sec15\text{ operations/sec}, this consumes 15×5=75 WCUs15 \times 5 = 75\text{ WCUs}.
3
Sum the WCU requirements to find the total provisioned WCU.
195195 WCUs
Combining the transactional writes (120 WCUs120\text{ WCUs}) and standard writes (75 WCUs75\text{ WCUs}) yields a total required write capacity of 195 WCUs195\text{ WCUs}.
4
Calculate the Read Capacity Units (RCUs) required for the 4040 TransactGetItems operations per second.
160160 RCUs
Transactional reads are strongly consistent and consume double the capacity of standard strongly consistent reads. Reading a 6 KB6\text{ KB} item requires rounding up to the nearest 4 KB4\text{ KB} boundary (8 KB8\text{ KB}), consuming 2 RCUs2\text{ RCUs} for a standard strongly consistent read. Doubling this for the transaction results in 4 RCUs4\text{ RCUs} per operation. For 40 operations/sec40\text{ operations/sec}, this consumes 40×4=160 RCUs40 \times 4 = 160\text{ RCUs}.
5
Evaluate the architectural and security configurations.
Use the default credential provider chain and query/retrieve items directly rather than scanning.
Hardcoding credentials violates security best practices, and using Scan operations instead of Query or specific read APIs is highly inefficient and consumes excess RCUs.

Key Concept

DynamoDB capacity calculation for transactional and standard operations combined with security and query optimization
Estimated Time:3m 0s
Rate this question