A fleet management system stores real-time diagnostics for delivery vehicles in an Amazon DynamoDB table. To minimize read latency and prevent database load, a developer deploys a DynamoDB Accelerator (DAX) cluster. The developer implements a background process that runs periodic Scan operations via the DAX client to pre-warm the cache. However, when the dashboard application performs GetItem calls to retrieve individual vehicle details, it continues to experience high read latency and triggers ProvisionedThroughputExceededException errors on the DynamoDB table. Which action should the developer take to resolve the performance bottleneck and utilize the DAX cache effectively?
- Modify the background process to perform individual GetItem or BatchGetItem calls for the vehicle records instead of Scan operations, allowing DAX to populate its item cache.Answer
- BIncrease the table's provisioned Read Capacity Units (RCUs) to handle the dashboard traffic and run the background Scan operations during off-peak hours.
- CChange the table's partition key to a low-entropy attribute like vehicle status and increase the read capacity units to resolve the throttling errors.
- DReplace the DAX cluster with an Amazon ElastiCache for Redis cluster, and configure the application to run nightly Scan operations to load the vehicle diagnostics into the Redis cache.
Answer
Modify the background process to perform individual GetItem or BatchGetItem calls for the vehicle records instead of Scan operations, allowing DAX to populate its item cache.
The correct answer is to modify the background process to perform individual GetItem or BatchGetItem calls. Amazon DynamoDB Accelerator (DAX) utilizes two separate caches: the item cache and the query cache. GetItem and BatchGetItem operations check and populate the item cache. Scan and Query operations check and populate the query cache. Because the background process was using Scan, it only populated the query cache. Subsequent GetItem requests from the dashboard resulted in item cache misses and went directly to DynamoDB, causing latency and throttling. Warming the item cache using GetItem or BatchGetItem resolves this issue.
Step-by-Step Solution
Key Concept
DAX Caching Behavior (Item Cache vs. Query Cache)