A digital ticketing platform experiences massive traffic spikes when tickets for popular events go on sale. The platform must process ticket reservation requests in the exact order they are received to prevent overbooking. The platform's relational database cannot handle the sudden spike in write requests directly. Which solution decouples the ingestion layer from the database while maintaining strict message ordering?
- Use an Amazon SQS FIFO queue to buffer the reservation requests, and configure an AWS Lambda function to process the messages and update the database.Answer
- BUse a standard Amazon SQS queue to buffer the reservation requests, and configure an AWS Lambda function to process the messages and update the database.
- CPublish the reservation requests to an Amazon SNS standard topic, and configure an AWS Lambda function subscribed to the topic to write updates to the database.
- DRoute the reservation requests to Amazon EventBridge, and configure an AWS Step Functions state machine to write the updates directly to the database.
Answer
Use an Amazon SQS FIFO queue to buffer the reservation requests, and configure an AWS Lambda function to process the messages and update the database.
The correct solution uses an Amazon SQS FIFO queue to buffer reservation requests. SQS FIFO queues guarantee that messages are processed in the exact order they are received and prevent duplicates. An AWS Lambda function can poll the queue to process messages at a controlled rate, successfully protecting the database from write spikes while maintaining transaction ordering.
Step-by-Step Solution
Key Concept
Using Amazon SQS FIFO queues to guarantee strict order processing and decouple components under heavy load.
Estimated Time:1m 30s