Question

Difficulty: HardHigh-Performing Content Delivery and Caching Solutions

A company hosts a global product search catalog API on Amazon API Gateway. The API invokes AWS Lambda functions to query a highly read-heavy Amazon DynamoDB table. During promotional events, search latency spikes significantly due to redundant queries for the same product categories, leading to read throttling on the database. The solutions architect must implement a caching solution that reduces end-to-end latency to under 50 milliseconds for repeat queries, maintains cost efficiency, and ensures catalog updates are visible globally within 5 minutes.

Which two configuration changes should the solutions architect recommend to satisfy these requirements? (Select TWO.)

  1. Enable API Gateway caching for the production stage, configure the cache keys based on search query string parameters, and set the Time-to-Live (TTL) to 300 seconds.Answer
  2. Deploy an Amazon DynamoDB Accelerator (DAX) cluster to cache database read operations, and modify the Lambda functions to use the DAX client SDK instead of the standard DynamoDB client.Answer
  3. C
    Provision an Amazon CloudFront distribution in front of the API Gateway, and configure a custom cache policy with the Minimum TTL, Default TTL, and Maximum TTL all set to 0 seconds.
  4. D
    Configure the DynamoDB table to use Provisioned Capacity Mode with static, highly over-provisioned Read Capacity Units (RCUs) to handle maximum peak spikes.
  5. E
    Re-design the DynamoDB table's primary key schema to use a monotonically increasing timestamp partition key to guarantee chronological data distribution.

Answer

Enabling API Gateway stage caching with query string parameter cache keys and a 300-second TTL, combined with deploying an Amazon DynamoDB Accelerator (DAX) cluster using the DAX SDK client.
Enabling caching at the API Gateway stage using the search query string parameters as cache keys allows identical user requests to be served directly from the API Gateway cache. This minimizes end-to-end response times to milliseconds and prevents backend Lambda invocations. The 300-second TTL aligns with the requirement that catalog updates are visible within 5 minutes. For API cache misses, deploying an Amazon DynamoDB Accelerator (DAX) cluster ensures that database read requests are served with microsecond latency, preventing DynamoDB read throttling and ensuring overall application performance.

Step-by-Step Solution

1
Analyze latency and database load requirements.
Identified the need to cache responses at the edge/API Gateway layer to minimize latency (under 50 ms) and to cache database queries to prevent throttling on DynamoDB.
This establishes a multi-tier caching strategy that offloads traffic before it hits compute and database layers.
2
Evaluate and configure API Gateway caching.
Enabling API Gateway caching with a 300-second (5 minutes) TTL caches GET requests globally, reducing both Lambda execution count and database reads.
API Gateway caching reduces end-to-end response times to milliseconds and satisfies the 5-minute global cache propagation requirement.
3
Evaluate and configure database caching.
Deploying Amazon DynamoDB Accelerator (DAX) caches read requests from the Lambda function, responding in microseconds for queries that miss the API Gateway cache.
DAX acts as a write-through cache that automatically manages database invalidation, avoiding the complexity of custom cache sync logic while protecting DynamoDB from throttling.

Key Concept

Multi-tier caching utilizing API Gateway stage caching and Amazon DynamoDB Accelerator (DAX) to optimize response times and protect downstream database resources.
Rate this question