Soru

Zorluk: OrtaOptimizing Performance with Caching and DAX

A flight scheduling application retrieves flight status details from an Amazon DynamoDB table using the flight number as the partition key. During peak holiday seasons, a sudden surge in search requests for a small set of popular flights causes a latency spike and throws ProvisionedThroughputExceededException errors. The developer needs to optimize the application's performance, achieving sub-millisecond read latency without rewriting the database access patterns or changing the primary key design. Which of the following solutions should the developer implement?

  1. A
    Increase the provisioned read capacity units (RCUs) on the DynamoDB table to handle the overall load, assuming the latency is due to table-wide limit constraints.
  2. B
    Replace the partition key queries with DynamoDB Scan operations containing a filter expression, and increase the provisioned read capacity units (RCUs) on the table.
  3. Deploy an Amazon DynamoDB Accelerator (DAX) cluster and configure the application to use the DAX client SDK.Cevap
  4. D
    Package the application database logic in an AWS Lambda function with an increased execution timeout, relying on Lambda execution context reuse to cache query results locally.

Cevap

Deploying an Amazon DynamoDB Accelerator (DAX) cluster and configuring the application to use the DAX client SDK is the correct solution.
The correct solution is to deploy an Amazon DynamoDB Accelerator (DAX) cluster and use the DAX client SDK. DAX provides a fully managed, in-memory cache directly in front of DynamoDB that delivers microsecond response times for read-heavy workloads. Because it is API-compatible, it requires minimal changes to the application (only the client initialization needs to be updated to point to the DAX cluster instead of DynamoDB directly), satisfying the requirement to avoid rewriting database access patterns.

Adım Adım Çözüm

1
Identify the root cause of the performance bottleneck.
A surge in read requests for specific popular keys (hot partition key problem) is causing read throttling (ProvisionedThroughputExceededException) and high read latency.
Understanding the access pattern helps determine the appropriate caching or scaling strategy.
2
Evaluate the latency and application-level constraints.
The application requires sub-millisecond (microsecond) read latencies without rewriting the data access logic or altering the primary keys.
Amazon ElastiCache would require custom code integration for lookups and invalidation, whereas DAX is API-compatible.
3
Select the optimization solution.
Amazon DynamoDB Accelerator (DAX) meets the latency requirements and integrates seamlessly via the DAX client SDK without changes to database access code.
DAX provides a fully managed, highly available write-through cache that reduces read response times to microseconds.

Anahtar Kavram

Caching read-heavy DynamoDB tables using DynamoDB Accelerator (DAX) to resolve hot partition keys and achieve microsecond latency.
Bu soruyu puanla