AWS Certified Developer – Associate (DVA-C02) — Question 249
A company has migrated an application to Amazon EC2 instances. Automatic scaling is working well for the application user interface. However, the process to deliver shipping requests to the company’s warehouse staff is encountering issues. Duplicate shipping requests are arriving, and some requests are lost or arrive out of order.
The company must avoid duplicate shipping requests and must process the requests in the order that the requests arrive. Requests are never more than 250 KB in size and take 5-10 minutes to process. A developer needs to rearchitect the application to improve the reliability of the delivery and processing of the requests.
What should the developer do to meet these requirements?
Answer options
- A. Create an Amazon Kinesis Data Firehose delivery stream to process the requests. Create an Amazon Kinesis data stream. Modify the application to write the requests to the Kinesis data stream.
- B. Create an AWS Lambda function to process the requests. Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the Lambda function to the SNS topic. Modify the application to write the requests to the SNS topic.
- C. Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) standard queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.
- D. Create an AWS Lambda function to process the requests. Create an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the SQS queue as an event source for the Lambda function. Modify the application to write the requests to the SQS queue.
Correct answer: D
Explanation
The correct answer is D because using a FIFO SQS queue ensures that the requests are processed in the exact order they arrive and prevents duplicate messages through the use of message deduplication. Option A is incorrect as Kinesis does not guarantee order and can lead to duplicates. Option B fails to provide ordering and duplicates can occur with SNS as it is not designed for strict request processing order. Option C uses a standard SQS queue which does not guarantee order and can also lead to duplicates.