Event-Driven Image Processing with Lambda and SQS

SAA-C03 By islever Editorial Last updated

Short answer

A Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an AWS Lambda function to read the messages from the queue and to process the images.

Question

A company has an application that customers use to upload images to an Amazon S3 bucket. Each night, the company launches an Amazon EC2 Spot Fleet that processes all the images that the company received that day. The processing for each image takes 2 minutes and requires 512 MB of memory. A solutions architect needs to change the application to process the images when the images are uploaded. Which change will meet these requirements MOST cost-effectively?
  1. Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an AWS Lambda function to read the messages from the queue and to process the images. Correct Answer
  2. Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an EC2 Reserved Instance to read the messages from the queue and to process the images.
  3. Use S3 Event Notifications to publish a message with image details to an Amazon Simple Notification Service (Amazon SNS) topic. Configure a container instance in Amazon Elastic Container Service (Amazon ECS) to subscribe to the topic and to process the images.
  4. Use S3 Event Notifications to publish a message with image details to an Amazon Simple Notification Service (Amazon SNS) topic. Configure an AWS Elastic Beanstalk application to subscribe to the topic and to process the images.

Key Takeaways

The common trap is choosing persistent compute like EC2 or managed platforms like Elastic Beanstalk when the workload is sporadic and short-duration; recognizing that Lambda fits the 2-minute duration constraint is key.

This question tests designing a cost-effective, event-driven architecture for processing S3 uploads using AWS Lambda and Amazon SQS. The correct solution leverages serverless compute to replace inefficient batch processing.

Common mistake: Candidates often choose EC2 Reserved Instances (Option B) believing they offer long-term savings, failing to realize that idle capacity during non-processing hours makes this far more expensive than pay-per-use Lambda for intermittent tasks.

Expert Analysis

Why the Answer Is Correct

Using S3 Event Notifications to trigger an SQS queue, which then invokes an AWS Lambda function, is the most cost-effective and scalable approach. Lambda handles the 2-minute processing time (well within its 15-minute limit) and low memory requirements without provisioning overhead. SQS provides decoupling and ensures no images are lost if the system is temporarily busy, offering better reliability than direct SNS fan-out.

Why the Other Options Are Wrong

Option B (EC2 Reserved Instances) incurs fixed hourly costs regardless of usage, making it inefficient for sporadic nightly or real-time bursts compared to Lambda's per-invocation pricing. Option C (ECS) and Option D (Elastic Beanstalk) involve managing containers or application servers, adding significant operational overhead and baseline costs that are unnecessary for simple image processing. Additionally, SNS alone does not provide the buffering capability needed if processing lags behind upload spikes.

Community Comment Notes

Community consensus strongly supports Option A, with users noting that "Lambda should be perfect scalable solution which will allow for almost in real time image processing." Another commenter highlighted that "Reserved instances are more expensive than Spot Fleet" for this use case due to idle time, while others emphasized that "SQS needed NOT SNS" because of the need for reliable message queuing rather than just notification.

Exam Strategy

Always evaluate the 'cost-effectiveness' and 'scale' constraints first. For sporadic, short-duration tasks triggered by events, prefer serverless options like Lambda over provisioned infrastructure like EC2 or ECS unless specific persistence or state management is required.

Frequently Asked Questions

Why is SQS preferred over SNS for triggering Lambda?

SQS provides buffering and retry capabilities, ensuring messages are processed even if Lambda fails or scales slowly. SNS is a pub/sub service that delivers notifications immediately but does not buffer messages if the subscriber is overwhelmed.

Can Lambda handle 2-minute processing times?

Yes, the maximum execution timeout for AWS Lambda is 900 seconds (15 minutes), which comfortably covers the 2-minute requirement specified in the scenario.

More SAA-C03 FAQ →

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 7 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 7

  1. aesopx39078 👍 12
    Congratulations! Once again, You made it!
  2. Scheldon 👍 8 Answered A
    Answer A I would go with Lambda and SQS. when using SQS we will be sure that all images will be processed and hence to process we need 2 min and 512 MB of memory (Lambda is allowing upto 15 min and upto10K MB) Lambda should be perfect scalable solution which will allow for almost in real time image processing.
  3. trinh_le 👍 6 Answered A
    less than 5 minutes -> use lambda
  4. NSA_Poker 👍 5 Answered A
    (B) is eliminated. Reserved instances are more expensive than Spot Fleet. (C) is eliminated. Container instance more expensive than Lambda. SQS needed NOT SNS. (D) is eliminated. Elastic Beanstalk is more expensive than Spot Fleet. SQS needed NOT SNS. (A) is correct. It's the most cost effective service & the scope of its capabilities are within the requirements.
  5. DanielWuTRT 👍 5 Answered A
    We made it to the last one! Good luck!
Show 2 more comments
  1. kevindu 👍 3
    Is there anyone who has recently passed the exam who can tell me approximately how many of the original questions are in the actual exam?
  2. muhammadahmer36 👍 2 Answered A
    A. Use S3 Event Notifications to write a message with image details to an Amazon Simple Queue Service (Amazon SQS) queue. Configure an AWS Lambda function to read the messages from the queue and to process the images.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All SAA-C03 Questions

Access 120 questions with complete answers and detailed explanations.

View Full SAA-C03 Practice Test →

← Back to SAA-C03 Study Guide