AWS Certified Developer – Associate / Question #808 of 557

Question #808

A developer has created an image processing application using Amazon API Gateway, AWS Lambda, and Amazon S3. Users periodically upload high-resolution images and wait for the processing status to be displayed on a dashboard. The processing is resource-intensive and time-consuming for large images. Users uploading multiple images have to wait and refresh the dashboard to check the status. The developer needs to update the dashboard in real-time without requiring a full reload.

What is the MOST operationally efficient solution that meets these requirements?

A

Integrate the client with an API Gateway WebSocket API. Associate the uploaded images with the WebSocket connection ID. Push the processing status to the connection ID upon completion to trigger a real-time dashboard update.

B

Deploy an Amazon EC2 micro instance to host a WebSocket server. Forward uploaded images and user details to the EC2 instance after upload. Use the WebSocket server to notify the client for real-time dashboard updates when processing finishes.

C

Store the user\u2019s email address with each uploaded image. Use Amazon Simple Notification Service (Amazon SNS) to send an email notification to the user when processing completes, prompting them to check the dashboard.

D

Save uploaded images and user details in Amazon DynamoDB. Configure Amazon DynamoDB Streams with Amazon Simple Notification Service (Amazon SNS) to send browser notifications and update the user interface automatically.

Explanation

Answer A is correct because:
- API Gateway WebSocket API enables persistent, bidirectional communication between the client and server. When a user uploads an image, the WebSocket connection ID is associated with the upload. Once processing completes, Lambda can push the status directly to the client via the WebSocket connection, updating the dashboard in real-time.
- Operational Efficiency: API Gateway is fully managed, eliminating the need to maintain servers (unlike Option B's EC2 instance). It integrates seamlessly with Lambda, which is already part of the architecture.

Other options are incorrect because:
- B: Requires managing an EC2 instance, which introduces operational overhead (scaling, availability, patching).
- C: Relies on email notifications, which are not real-time and require manual dashboard reloading.
- D: DynamoDB Streams and SNS alone cannot push real-time updates to a browser UI without additional client-side mechanisms (e.g., polling or WebSockets).

Key Points: Use WebSocket APIs for real-time client-server communication in serverless architectures. Managed services like API Gateway reduce operational complexity.

Answer

The correct answer is: A