Skip to Content

SAP-C02: Scalable Image Service with AWS S3, SQS, and CloudFront

Discover how to build a scalable and highly available image service on AWS, allowing users to upload and process images using Amazon S3, SQS, EC2 Auto Scaling, and CloudFront for low-latency delivery.

Table of Contents

Question

A company is building an image service on the web that will allow users to upload and search random photos. At peak usage, up to 10,000 users worldwide will upload their images. The will then overlay text on the uploaded images, which will then be published on the company website.

Which design should a solutions architect implement?

A. Store the uploaded images in Amazon Elastic File System (Amazon EFS). Send application log information about each image to Amazon CloudWatch Logs. Create a fleet of Amazon EC2 instances that use CloudWatch Logs to determine which images need to be processed. Place processed images in another directory in Amazon EFS. Enable Amazon CloudFront and configure the origin to be the one of the EC2 instances in the fleet.
B. Store the uploaded images in an Amazon S3 bucket and configure an S3 bucket event notification to send a message to Amazon Simple Notification Service (Amazon SNS). Create a fleet of Amazon EC2 instances behind an Application Load Balancer (ALB) to pull messages from Amazon SNS to process the images and place them in Amazon Elastic File System (Amazon EFS). Use Amazon CloudWatch metrics for the SNS message volume to scale out EC2 instances. Enable Amazon CloudFront and configure the origin to be the ALB in front of the EC2 instances.
C. Store the uploaded images in an Amazon S3 bucket and configure an S3 bucket event notification to send a message to the Amazon Simple Queue Service (Amazon SQS) queue. Create a fleet of Amazon EC2 instances to pull messages from the SQS queue to process the images and place them in another S3 bucket. Use Amazon CloudWatch metrics for queue depth to scale out EC2 instances. Enable Amazon CloudFront and configure the origin to be the S3 bucket that contains the processed images.
D. Store the uploaded images on a shared Amazon Elastic Block Store (Amazon EBS) volume mounted to a fleet of Amazon EC2 Spot instances. Create an Amazon DynamoDB table that contains information about each uploaded image and whether it has been processed. Use an Amazon EventBridge rule to scale out EC2 instances. Enable Amazon CloudFront and configure the origin to reference an Elastic Load Balancer in front of the fleet of EC2 instances.

Answer

C. Store the uploaded images in an Amazon S3 bucket and configure an S3 bucket event notification to send a message to the Amazon Simple Queue Service (Amazon SQS) queue. Create a fleet of Amazon EC2 instances to pull messages from the SQS queue to process the images and place them in another S3 bucket. Use Amazon CloudWatch metrics for queue depth to scale out EC2 instances. Enable Amazon CloudFront and configure the origin to be the S3 bucket that contains the processed images.

Explanation

This design leverages multiple AWS services to provide a scalable, highly available, and cost-effective solution for the image service.

By storing the uploaded images in an Amazon S3 bucket and configuring an event notification to send a message to an Amazon SQS queue, the solution decouples the image upload process from the image processing. This allows for asynchronous and parallel processing of images, improving scalability and responsiveness.

A fleet of EC2 instances can efficiently process the messages from the SQS queue, overlaying text on the images and storing the processed images in another S3 bucket. By using CloudWatch metrics for the SQS queue depth, the EC2 instances can be automatically scaled out to handle increased workloads, ensuring high availability and efficient resource utilization.

Enabling Amazon CloudFront and configuring the origin to be the S3 bucket containing the processed images provides a highly available and low-latency content delivery solution. CloudFront caches the processed images closer to users, reducing latency and improving the user experience.

This design separates concerns, leverages the scalability and durability of S3 and SQS, and utilizes auto-scaling capabilities to handle varying workloads efficiently. Additionally, by serving the processed images from CloudFront, the solution ensures low latency and high availability for users worldwide.

Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Solutions Architect – Professional SAP-C02 exam and earn Amazon AWS Certified Solutions Architect – Professional SAP-C02 certification.