Soru

Zorluk: OrtaApplication Caching and Session State Management

A developer is building a serverless application using AWS Lambda and Amazon DynamoDB. The application experiences high-frequency read requests for a small subset of popular items, leading to DynamoDB throttling and ProvisionedThroughputExceededException errors. The developer needs to implement a caching solution that requires minimal application code changes, provides sub-millisecond response times, and automatically updates the cache when database items are updated. Which solution should the developer implement to meet these requirements?

  1. A
    Cache the queried items in AWS Systems Manager Parameter Store and configure a Time to Live (TTL) parameter for eviction.
  2. B
    Deploy an Amazon ElastiCache for Memcached cluster and implement write-through caching logic in the Lambda function code.
  3. Enable Amazon DynamoDB Accelerator (DAX) and configure the application to use the DAX client SDK.Cevap
  4. D
    Store the retrieved items in the AWS Lambda execution context's global variables to serve subsequent requests from memory.

Cevap

Enable Amazon DynamoDB Accelerator (DAX) and configure the application to use the DAX client SDK.
The correct answer is to enable Amazon DynamoDB Accelerator (DAX) and use the DAX client SDK. DAX provides a fully managed, highly available in-memory cache specifically for DynamoDB. It is API-compatible with DynamoDB, which means developers only need to point their existing SDK client to the DAX endpoint rather than rewriting application logic. DAX transparently manages cache hits, misses, and updates, ensuring that write-through operations keep the cache current.

Adım Adım Çözüm

1
Analyze the requirements for low-latency caching, automatic updates/invalidation, and minimal code changes.
Identify that the solution must integrate natively with DynamoDB without requiring complex cache-aside or write-through application logic.
This narrows down options to DynamoDB-native or API-compatible caching layers.
2
Evaluate Amazon DynamoDB Accelerator (DAX) against the requirements.
DAX provides sub-millisecond response times, is API-compatible (requiring only a change in the SDK client initialization), and handles cache invalidation and updates transparently.
To verify that DAX is the optimal fit for the scenario.
3
Compare against alternatives such as ElastiCache, Systems Manager Parameter Store, and Lambda execution context reuse.
Eliminate ElastiCache due to code complexity, Parameter Store due to rate limits and purpose misfit, and Lambda context reuse due to statelessness and synchronization issues.
To ensure distractors are systematically eliminated based on the scenario constraints.

Anahtar Kavram

DynamoDB Accelerator (DAX) is an in-memory, write-through cache that is API-compatible with DynamoDB, minimizing code changes while offloading read-heavy hot partitions.
Bu soruyu puanla