Soru

Zorluk: ZorHigh-Performing Content Delivery and Caching Solutions

A global news website serves static web assets (images, CSS, JS files) stored in an Amazon S3 bucket, and dynamic personalized articles generated by an API running on Amazon EC2 instances in private subnets behind an Application Load Balancer (ALB). The API retrieves article content from an Amazon RDS database. During breaking news events, the website experiences significant latency, and both the ALB and the S3 bucket are overloaded by traffic spikes. Additionally, the application generates transient log files that must be stored in Amazon S3 for exactly 7 days before deletion. Which TWO solutions should a solutions architect implement to optimize content delivery performance and minimize operational costs?

  1. Configure an Amazon CloudFront distribution with the ALB as the origin for dynamic content paths and the S3 bucket as the origin for static content paths. Enable caching on the static behaviors to offload requests from the S3 bucket.Cevap
  2. Deploy Amazon ElastiCache in front of the Amazon RDS database to cache frequently requested article data in memory, reducing load on the database and decreasing API response times.Cevap
  3. C
    Configure an Amazon CloudFront distribution with all cache behaviors pointing to the ALB and S3 origins, and set the Default TTL, Minimum TTL, and Maximum TTL to 0 seconds to guarantee that users always receive the most recent static updates directly from the origins.
  4. D
    Store the transient API log files in the Amazon S3 Standard-Infrequent Access (S3 Standard-IA) storage class, and define an S3 Lifecycle policy to permanently delete the objects after 7 days to minimize storage costs.
  5. E
    Route all internal data transfers between the EC2 instances in the private subnets and the S3 bucket through a NAT Gateway, and configure a CloudFront distribution with the NAT Gateway's public IP as an origin to accelerate internal traffic.

Cevap

Configure an Amazon CloudFront distribution with the ALB as the origin for dynamic content paths and the Amazon S3 bucket as the origin for static content paths, caching only the static assets. Simultaneously, deploy Amazon ElastiCache in front of the database to cache frequently accessed dynamic query results.
Configuring Amazon CloudFront with separate behaviors ensures that static content is cached close to users, reducing latency and offloading the S3 bucket. Dynamic routes are passed through directly to the Application Load Balancer to guarantee personalization. At the database tier, Amazon ElastiCache caches recurrent query results in memory, drastically reducing the load on the RDS instance and accelerating the overall API response time.

Adım Adım Çözüm

1
Analyze the static asset delivery flow.
Identify that CloudFront can cache S3 objects at edge locations, offloading the S3 bucket and reducing latency.
Serving static files directly from CloudFront caches prevents traffic spikes from overwhelming the S3 origin.
2
Analyze database and dynamic API performance.
Identify that deploying Amazon ElastiCache in front of Amazon RDS caches frequent read queries.
An in-memory cache reduces RDS processor utilization and speeds up dynamic data retrieval.
3
Evaluate the transient log storage requirement.
Recognize that S3 Standard-IA has a 30-day minimum storage billing period. Deleting logs in 7 days incurs a cost penalty, so S3 Standard should be used instead.
Avoids unnecessary charges associated with early deletion in infrequent access tiers.
4
Evaluate routing mechanisms.
Verify that using a NAT Gateway for high-volume internal data transfers is highly expensive compared to using a free Gateway VPC Endpoint for S3.
Minimizes data processing costs and enhances internal performance.

Anahtar Kavram

Multi-tier caching using Amazon CloudFront and Amazon ElastiCache, alongside cost-optimization strategies for short-term storage and internal network routing.
Bu soruyu puanla