
Answer-first summary for fast verification
Answer: Distribute order IDs via an Amazon SNS FIFO topic to separate Amazon SQS FIFO queues for concurrent inventory management and payment processing.
Option A is the correct solution because it utilizes an Amazon SNS FIFO topic to fan out order IDs to two separate Amazon SQS FIFO queues: one for inventory management and one for payment processing. The FIFO (First-In-First-Out) nature of these queues ensures that the orders are processed in the exact sequence they are received. This maintains the required order integrity, meaning that if a seat is sold more than once, the first order received will be processed first. If the payment for the first order fails, the FIFO queue allows the second order to be processed next, ensuring the seat allocation and payment rules are followed correctly.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a serverless application for concert seat selection, which architecture ensures that in case of duplicate seat sales, the first order is prioritized for seat allocation and payment processing, and if its payment fails, the second order is then processed?
A
Distribute order IDs via an Amazon SNS FIFO topic to separate Amazon SQS FIFO queues for concurrent inventory management and payment processing.
B
Initiate inventory management with the Lambda function generating order IDs, followed by initiating payment processing.
C
Send order IDs through an Amazon SNS topic with Lambda functions for inventory and payment processing subscribed to receive these IDs.
D
Insert order IDs into an Amazon SQS queue for polling by Lambda functions responsible for inventory management and payment processing.
No comments yet.