DVA-C02 · Question #266
A developer has created a data collection application that uses Amazon API Gateway, AWS Lambda, and Amazon S3. The application's users periodically upload data files and wait for the validation status
The correct answer is A. Integrate the client with an API Gateway WebSocket API. Save the user-uploaded files with the. An API Gateway WebSocket API enables a persistent bidirectional connection that allows the server to push validation results to the client dashboard in real time without requiring a page reload.
Question
A developer has created a data collection application that uses Amazon API Gateway, AWS Lambda, and Amazon S3. The application's users periodically upload data files and wait for the validation status to be reflected on a processing dashboard. The validation process is complex and time-consuming for large files. Some users are uploading dozens of large files and have to wait and refresh the processing dashboard to see if the files have been validated. The developer must refactor the application to immediately update the validation result on the user's dashboard without reloading the full dashboard. What is the MOST operationally efficient solution that meets these requirements?
Options
- AIntegrate the client with an API Gateway WebSocket API. Save the user-uploaded files with the
- BLaunch an Amazon EC2 micro instance, and set up a WebSocket server. Send the user-
- CSave the user's email address along with the user-uploaded file. When the validation process is
- DSave the user-uploaded file and user detail to Amazon DynamoDB. Use Amazon DynamoDB
How the community answered
(34 responses)- A65% (22)
- B21% (7)
- C9% (3)
- D6% (2)
Why each option
An API Gateway WebSocket API enables a persistent bidirectional connection that allows the server to push validation results to the client dashboard in real time without requiring a page reload.
API Gateway WebSocket APIs maintain a persistent connection between the client and the server. When the Lambda validation process completes, it can use the connection ID stored with the file to call the API Gateway Management API and push the result directly to the connected client's dashboard. This eliminates polling and is fully serverless with minimal operational overhead.
Launching an EC2 micro instance to host a WebSocket server introduces significant operational overhead including instance management, patching, and availability concerns, which contradicts the serverless architecture already in use.
Sending an email notification requires the user to leave the dashboard to check email and then return, which does not meet the requirement of immediately updating the dashboard without a full reload.
DynamoDB Streams with a Lambda polling mechanism is a backend event-driven pattern but still requires the client to poll or use another mechanism to receive updates; it does not push results to the user's dashboard in real time.
Concept tested: API Gateway WebSocket API for real-time server-to-client push notifications
Source: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html
Community Discussion
No community discussion yet for this question.