Soru

Zorluk: OrtaHigh-Performing Content Delivery and Caching Solutions

A global weather application serves forecast data that is updated once every 15 minutes. The backend architecture consists of Amazon Route 53, Amazon API Gateway, AWS Lambda, and Amazon DynamoDB. The application experiences a high volume of read requests. The development team wants to optimize read performance, reduce the compute load on AWS Lambda, and keep integration changes minimal. Which of the following solutions should a solutions architect recommend?

  1. Enable caching on the API Gateway stage with a Time-to-Live (TTL) of 900 seconds.Cevap
  2. B
    Deploy Amazon CloudFront in front of the API Gateway, and configure a cache behavior with a Minimum, Maximum, and Default TTL of 0 seconds.
  3. C
    Configure the Amazon DynamoDB table in Provisioned Capacity mode and scale up the Read Capacity Units (RCUs) to handle the peak request rate.
  4. D
    Configure Amazon Route 53 Latency routing to distribute requests across multiple regional API Gateway endpoints.

Cevap

Enable caching on the API Gateway stage with a Time-to-Live (TTL) of 900 seconds.
Enabling caching on the API Gateway stage with a Time-to-Live (TTL) of 900 seconds allows API Gateway to respond to client requests using cached data. Because the weather forecast data changes only every 15 minutes, a 900-second cache duration aligns perfectly with the update cycle. This solution prevents duplicate requests from triggering AWS Lambda, thereby reducing compute load and database queries while lowering overall latency.

Adım Adım Çözüm

1
Identify the caching layer that can intercept requests before they invoke the compute layer (AWS Lambda).
API Gateway caching is selected because it is positioned in front of AWS Lambda.
To reduce AWS Lambda compute load, the caching layer must serve responses before invoking the Lambda function.
2
Determine the optimal Time-to-Live (TTL) based on the data update frequency.
Set the TTL to 900 seconds (15 minutes).
Since the weather forecast data only updates every 15 minutes, caching the data for 900 seconds ensures users get up-to-date forecasts while maximizing cache hits.

Anahtar Kavram

API Gateway Caching
Tahmini Süre:1m 30s
Bu soruyu puanla