
Answer-first summary for fast verification
Answer: Create an Amazon Simple Queue Service (Amazon SQS) message queue. As images are uploaded, place a message on the SQS queue for thumbnail generation. Alert the user through an application message that the image was received.
## Explanation **Correct Answer: C** **Why Option C is correct:** 1. **Asynchronous processing**: Amazon SQS provides a reliable queue service that allows the application to immediately acknowledge image upload completion while queuing the thumbnail generation task for background processing. 2. **Fast response time**: The application can immediately return a success message to the user after placing the message in the SQS queue, without waiting for the thumbnail generation (which can take up to 60 seconds). 3. **Decoupling**: SQS decouples the image upload process from the thumbnail generation process, allowing them to scale independently. 4. **Reliability**: SQS ensures messages are delivered at least once and can handle retries if thumbnail generation fails. **Why other options are incorrect:** **Option A (AWS Lambda):** - Lambda functions have a maximum execution timeout of 15 minutes, but the requirement is for faster response time to users. - While Lambda could generate thumbnails, it would still need to complete the thumbnail generation before returning a response to the user, which contradicts the requirement for immediate notification. **Option B (AWS Step Functions):** - Step Functions is designed for workflow orchestration but doesn't provide the immediate response needed. - The user would have to wait for the entire workflow (including thumbnail generation) to complete before receiving confirmation. **Option D (Amazon SNS):** - SNS is a pub/sub messaging service, not a queue service. - It doesn't provide the same level of message persistence and guaranteed delivery as SQS. - The solution described would still require waiting for thumbnail generation before sending the push notification. **Key architectural principles demonstrated:** 1. **Decoupling components** using message queues 2. **Asynchronous processing** for long-running tasks 3. **Immediate user feedback** while processing in background 4. **Scalability** through independent component scaling
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A solutions architect is designing a multi-tier application for a company. The application's users upload images from a mobile device. The application generates a thumbnail of each image and returns a message to the user to confirm that the image was uploaded successfully.
The thumbnail generation can take up to 60 seconds, but the company wants to provide a faster response time to its users to notify them that the original image was received. The solutions architect must design the application to asynchronously dispatch requests to the different application tiers.
What should the solutions architect do to meet these requirements?
A
Write a custom AWS Lambda function to generate the thumbnail and alert the user. Use the image upload process as an event source to invoke the Lambda function.
B
Create an AWS Step Functions workflow. Configure Step Functions to handle the orchestration between the application tiers and alert the user when thumbnail generation is complete.
C
Create an Amazon Simple Queue Service (Amazon SQS) message queue. As images are uploaded, place a message on the SQS queue for thumbnail generation. Alert the user through an application message that the image was received.
D
Create Amazon Simple Notification Service (Amazon SNS) notification topics and subscriptions. Use one subscription with the application to generate the thumbnail after the image upload is complete. Use a second subscription to message the user's mobile app by way of a push notification after thumbnail generation is complete.
No comments yet.