A digital ticketing platform handles concert ticket purchases and cancellations. The transaction details must be processed in the exact sequence they are generated to ensure seat availability is calculated accurately. During ticket sales for major events, the portal experiences massive surges in traffic that overwhelm the backend database. A solutions architect needs to decouple the portal from the transaction processing backend to buffer traffic spikes while maintaining strict transaction order. Which solution meets these requirements with the least operational overhead?
- ASend the transaction updates to a standard Amazon SQS queue. Configure an AWS Lambda function to process the messages, relying on standard queue parameters to maintain the order of updates.
- BWrite transaction updates directly to an Amazon DynamoDB table configured in provisioned capacity mode, using an AWS Lambda function to buffer updates when throttling occurs.
- Send the transaction updates to an Amazon SQS FIFO queue. Configure an AWS Lambda function to process the messages, using the concert ID as the Message Group ID to ensure sequential processing of transactions for each concert.Cevap
- DSend the transaction updates to an Amazon SQS FIFO queue. Set up a continuously running AWS Lambda function that uses a long-polling loop to read messages and update the database.
Cevap
Send the transaction updates to an Amazon SQS FIFO queue, and configure an AWS Lambda function to process the messages, using the concert ID as the Message Group ID to ensure sequential processing of transactions for each concert.
The correct solution uses an Amazon SQS FIFO queue to decouple the ticketing portal from the database. SQS FIFO queues ensure first-in, first-out delivery. By setting the concert ID as the Message Group ID, all transactions relating to the same concert are processed in the order they occurred. Using an AWS Lambda function integrated as the event source represents the lowest operational overhead option, as AWS manages the polling infrastructure.
Adım Adım Çözüm
Anahtar Kavram
Decoupling message flows with order preservation using Amazon SQS FIFO queues and AWS Lambda.