Soru

Zorluk: OrtaHigh-Performing Content Delivery and Caching Solutions

A company hosts a recipe sharing portal on Amazon EC2 instances behind an Application Load Balancer (ALB). The portal serves static image files of recipes, which are currently stored on the EC2 instances' attached Amazon EBS volumes. The recipe images are updated daily by users. During peak traffic hours, the EC2 instances experience extreme CPU utilization and high network bandwidth consumption from serving these static images. A solutions architect needs to design a high-performing and cost-effective solution to offload the static image serving and improve response times.

Which solution should the solutions architect recommend?

  1. A
    Create an Amazon CloudFront distribution with the Application Load Balancer as the origin, and configure the cache behavior for the images with the default, minimum, and maximum Time to Live (TTL) set to 0.
  2. B
    Migrate the static images to an Amazon S3 Glacier Flexible Retrieval bucket, and configure the application to serve the images directly from S3 Glacier to minimize storage costs.
  3. Migrate the static images to an Amazon S3 Standard bucket, and create an Amazon CloudFront distribution with the S3 bucket as the origin to serve the images.Cevap
  4. D
    Migrate the static images to an Amazon S3 Standard-Infrequent Access (S3 Standard-IA) bucket to reduce storage costs, and configure the application to serve the images directly from the S3 bucket.

Cevap

Migrate the static images to an Amazon S3 Standard bucket, and create an Amazon CloudFront distribution with the S3 bucket as the origin to serve the images.
Migrating the static images to an Amazon S3 Standard bucket and serving them through Amazon CloudFront offloads all static asset requests from the Application Load Balancer and EC2 instances. CloudFront caches the images at edge locations close to users, reducing latency and lowering the compute and bandwidth load on the origin servers.

Adım Adım Çözüm

1
Migrate the static images from the EC2 instances' EBS volumes to an Amazon S3 Standard bucket.
The static images are stored in a scalable, highly available object storage service, eliminating EBS storage bottlenecks.
Amazon S3 is optimized for web-scale storage and serves as a highly scalable and cost-effective origin for content delivery networks.
2
Create an Amazon CloudFront distribution and set the Amazon S3 bucket as the origin.
Recipe images are cached at edge locations globally, closer to the users.
CloudFront reduces latency for end-users and offloads the read request traffic from the S3 origin.
3
Update the application configuration to reference the CloudFront distribution URLs instead of the EC2 local storage.
User requests for recipe images go directly to CloudFront, completely bypassing the ALB and EC2 instances.
This offloads the CPU and network bandwidth load from the compute tier, resolving the performance degradation.

Anahtar Kavram

Static content offloading and edge caching using Amazon S3 and Amazon CloudFront
Bu soruyu puanla