SAA-C03 Question 268
Select 2An e-commerce company wants to process user-uploaded product images. The company needs a highly scalable and cost-effective solution that automatically triggers image processing whenever a file is uploaded to an S3 bucket. The processed images should be stored back in another S3 bucket. Which combination of services and configurations should the company use?
- A
Configure an S3 bucket to trigger an AWS Lambda function upon object creation.
- B
Use Amazon ECS with Fargate to process the images in a containerized application.
- C
Store the processed images in the same S3 bucket as the source images.
- D
Write a Lambda function to process the images and store them in another S3 bucket.
- E
Enable Amazon SQS to send messages to trigger the processing.
Show answer and explanation
Correct answers: A, D
Explanation
The best solution for this scenario is to use S3 event notifications to trigger an AWS Lambda function whenever a new file is uploaded. The Lambda function can then process the images and store the results in a separate S3 bucket. This approach is serverless, scalable, and cost-effective, leveraging the event-driven architecture capabilities of AWS. Using Fargate or SQS adds unnecessary complexity and cost for this specific use case.
- A. Correct.
Correct. Configuring the S3 bucket to trigger a Lambda function on object creation is an event-driven, serverless way to process uploads automatically.
- B. Incorrect.
Incorrect. While Fargate can process images in a containerized application, it’s not the most serverless or cost-effective approach for this use case.
- C. Incorrect.
Incorrect. Storing processed images in the same bucket as the source images is not a recommended practice as it can cause overwriting and data management issues.
- D. Correct.
Correct. Writing a Lambda function to process images and store them in a separate S3 bucket aligns with serverless design patterns and ensures clear separation of source and processed data.
- E. Incorrect.
Incorrect. While Amazon SQS can be used for decoupling, it is not necessary in this case since S3’s event notification can directly trigger the Lambda function.