What should the solutions architect do to meet these requirements?
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.
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.
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.
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.
Explanations:
While AWS Lambda can process image uploads and generate thumbnails, it is not the best fit for asynchronous processing of large or time-consuming tasks. Using Lambda to directly generate the thumbnail after the image upload may lead to longer response times for the user, which contradicts the requirement to provide a faster confirmation.
AWS Step Functions can orchestrate the workflow but is an overkill for this simple use case. It introduces unnecessary complexity, especially when a simpler solution like an SQS queue can achieve the same result. Step Functions are typically more suitable for complex workflows with multiple stages and dependencies.
Using Amazon SQS to queue the thumbnail generation process allows the application to respond to the user immediately after the image upload. The image upload triggers the placement of a message in the SQS queue, and the image processing (thumbnail generation) is handled asynchronously, ensuring the user receives a fast response.
SNS notifications can notify the user and trigger actions in a downstream system, but using SNS for the thumbnail generation task itself is inefficient. SNS is designed for event-driven messaging and doesn’t provide the necessary control for managing a thumbnail generation task asynchronously. SQS would be more appropriate for queuing the image processing.