AWS Certified Solutions Architect Associate · Free Practice Question Hard
Question 42
A company has an ecommerce checkout workflow that writes an order to a database and calls a service to process the payment. Users are experiencing timeouts during the checkout process. When users resubmit the checkout form, multiple unique orders are created for the same desired transaction. How should a solutions architect refactor this workflow to prevent the creation of multiple orders?
- A Store the order in the database. Send a message that includes the order number to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. Set the payment service to retrieve the message and process the order. Delete the message from the queue.
- B Configure the web application to send an order message to Amazon Kinesis Data Firehose. Set the payment service to retrieve the message from Kinesis Data Firehose and process the order.
- C Create a rule in AWS CloudTrail to invoke an AWS Lambda function based on the logged application path request. Use Lambda to query the database, call the payment service, and pass in the order information.
- D Store the order in the database. Send a message that includes the order number to Amazon Simple Notification Service (Amazon SNS). Set the payment service to poll Amazon SNS, retrieve the message, and process the order.
Reveal correct answer
Correct answer: A
Explanation
To prevent the creation of multiple unique orders for the same transaction, the solutions architect should refactor the workflow by storing the order in the database and then sending a message that includes the order number to an Amazon Simple Queue Service (Amazon SQS) FIFO queue. The payment service should retrieve the message from the SQS FIFO queue, process the order, and then delete the message from the queue. This ensures that each order is processed exactly once, preventing duplicate orders.Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
