Soru

Zorluk: OrtaOptimizing Performance with Caching and DAX

A fleet management system stores real-time diagnostics for 50,00050,000 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?

  1. 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.Cevap
  2. B
    Increase the table's provisioned Read Capacity Units (RCUs) to handle the dashboard traffic and run the background Scan operations during off-peak hours.
  3. C
    Change the table's partition key to a low-entropy attribute like vehicle status and increase the read capacity units to resolve the throttling errors.
  4. D
    Replace 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.

Cevap

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.

Adım Adım Çözüm

1
Analyze how DAX handles cache population for different API calls.
DAX maintains an item cache (populated by GetItem, BatchGetItem, etc.) and a query cache (populated by Query and Scan).
Understanding the difference between DAX's item cache and query cache is necessary to diagnose why GetItem calls are bypassing the cache.
2
Identify the cause of the cache misses and read throttling.
The background process uses Scan, which only populates the query cache. Subsequent GetItem calls search the item cache, result in cache misses, and hit the DynamoDB table directly.
This explains why the table is receiving ProvisionedThroughputExceededException errors despite the DAX cluster.
3
Apply the appropriate caching strategy to resolve the bottleneck.
Changing the background warming process to use GetItem or BatchGetItem calls ensures that the individual vehicle items are cached in the DAX item cache.
This allows subsequent GetItem calls from the dashboard to be served directly from the DAX item cache, eliminating database load and reducing latency.

Anahtar Kavram

DAX Caching Behavior (Item Cache vs. Query Cache)
Bu soruyu puanla