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 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 using AWS Lambda to generate thumbnails is efficient, it doesn’t address the need for asynchronous communication between tiers effectively. The user would still need to wait for the thumbnail generation to complete before being notified, which does not meet the requirement of providing a faster response time to the user.
AWS Step Functions is suitable for orchestrating complex workflows, but it is more suited for cases that require maintaining state and managing multiple step executions. In this scenario, it would add unnecessary complexity for simply notifying users of a successful image upload, as it doesn’t inherently solve the need for quick acknowledgment.
Using Amazon SQS allows for the asynchronous processing of thumbnail generation. When an image is uploaded, a message can be placed on the SQS queue for processing without making the user wait. This way, the application can immediately send a confirmation message to the user that the image was received, fulfilling the requirement of a faster response time while handling thumbnail generation separately.
Although SNS can be used for sending notifications, using it to generate thumbnails introduces complexity without clear benefits. One subscription could be for generating the thumbnail, but it doesn’t inherently provide the required asynchronous communication. The immediate acknowledgment of the upload would still not be directly handled, as SNS is primarily for notifications rather than processing tasks.