AWS Certified Developer – Associate — Question 108

A developer is designing a serverless application that customers use to select seats for a concert venue. Customers send the ticket requests to an Amazon API Gateway API with an AWS Lambda function that acknowledges the order and generates an order ID. The application includes two additional Lambda functions: one for inventory management and one for payment processing. These two Lambda functions run in parallel and write the order to an Amazon Dynamo DB table.

The application must provide seats to customers according to the following requirements. If a seat is accidently sold more than once, the first order that the application received must get the seat. In these cases, the application must process the payment for only the first order. However, if the first order is rejected during payment processing, the second order must get the seat. In these cases, the application must process the payment for the second order.

Which solution will meet these requirements?

Answer options

Correct answer: A

Explanation

Option A is correct because using an Amazon SNS FIFO topic to fan out to SQS FIFO queues ensures that the order processing is handled in the precise order of receipt, which is essential for managing seat reservations. Option B fails to guarantee order processing since it runs the functions sequentially instead of in parallel. Option C does not provide the necessary ordering and delivery guarantees needed for this application. Option D lacks the FIFO capabilities required to ensure that the first order is prioritized correctly.