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.)
- 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.Cevap
- 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.Cevap
- CProvision 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.
- DConfigure the DynamoDB table to use Provisioned Capacity Mode with static, highly over-provisioned Read Capacity Units (RCUs) to handle maximum peak spikes.
- ERe-design the DynamoDB table's primary key schema to use a monotonically increasing timestamp partition key to guarantee chronological data distribution.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Multi-tier caching utilizing API Gateway stage caching and Amazon DynamoDB Accelerator (DAX) to optimize response times and protect downstream database resources.