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:
* `TransactWriteItems` operations per second. Each transaction contains two write actions: one writes a new item of , and another updates an existing item resulting in a final size of .
* standard `PutItem` operations per second, with an average item size of .
* `TransactGetItems` operations per second. Each transaction reads a single item of .
To ensure optimal performance, scalability, and security under the AWS shared responsibility model, which capacity provisioning and development strategy should the developer implement?
- Provision Write Capacity Units (WCUs) and 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.Cevap
- BProvision Write Capacity Units (WCUs) and 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.
- CProvision Write Capacity Units (WCUs) and 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.
- DProvision Write Capacity Units (WCUs) and Read Capacity Units (RCUs). If the application encounters a ProvisionedThroughputExceededException, immediately configure DynamoDB Auto Scaling to scale up provisioned capacity to resolve the error.
Cevap
Provision Write Capacity Units (WCUs) and 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 WCUs and 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 operations/second. Each operation has two write actions: a new item of (rounded up to , costing for transactional writes = ) and an update resulting in a item (rounded up to , costing for transactional writes = ). This totals per transaction, or for transactions/second. The standard PutItem workload consists of operations/second of (rounded up to , costing ). This consumes . Summing these values gives . The Read Capacity Unit (RCU) calculation is as follows: The TransactGetItems workload consists of operations/second. Each transaction reads one item (rounded up to the nearest boundary, which is , consuming ). Since transactional reads consume double the RCUs of strongly consistent reads, each transaction costs , totaling for operations/second.
Adım Adım Çözüm
Anahtar Kavram
DynamoDB capacity calculation for transactional and standard operations combined with security and query optimization
Tahmini Süre:3m 0s