Soru

Zorluk: OrtaOptimizing Performance with Caching and DAX

A software company operates a multi-tenant SaaS application that stores client organization profiles in an Amazon DynamoDB table. To minimize read latency for authorization checks, the developer deployed an Amazon DynamoDB Accelerator (DAX) cluster. However, an administrative microservice updates these organization profiles by writing directly to the DynamoDB table. Consequently, users report that profile updates take up to five minutes to reflect in the main application. Which of the following developer actions will resolve this cache staleness issue most efficiently?

  1. Configure the administrative microservice to perform write operations through the DAX cluster client rather than directly to the DynamoDB table.Cevap
  2. B
    Modify the main application to perform a full Scan operation on the DAX cluster every five minutes to refresh the cache for all client organization profiles.
  3. C
    Increase the provisioned read capacity units (RCUs) and write capacity units (WCUs) of the underlying DynamoDB table to handle the direct updates without partition throttling.
  4. D
    Configure the Lambda functions in the main application to initialize a new DAX client connection on every request rather than reusing the client across execution contexts.

Cevap

Configure the administrative microservice to perform write operations through the DAX cluster client rather than directly to the DynamoDB table.
Directing writes through the DAX cluster client ensures that DAX performs a write-through operation. This updates the DAX cache (item cache) synchronously while writing to the DynamoDB table, so subsequent reads immediately see the updated configuration.

Adım Adım Çözüm

1
Analyze the cache staleness behavior.
Identified that writes bypassing the DAX cluster do not invalidate or update the item cache in DAX, leading to stale reads until the Time to Live (TTL) expires.
Understanding how DAX maintains cache consistency is necessary to troubleshoot staleness issues.
2
Determine the write pattern needed for DAX.
DAX is designed as a write-through cache. Directing write operations through the DAX client updates both the cache and the underlying DynamoDB table.
Using a write-through pattern ensures the cache remains consistent with the database immediately after writes.

Anahtar Kavram

DAX Cache Consistency and Write-Through Strategy
Bu soruyu puanla