Soru

Zorluk: OrtaDecoupling Architectures and Event-Driven Messaging

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?

  1. 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.Cevap
  2. B
    Use a standard Amazon SQS queue to buffer the reservation requests, and configure an AWS Lambda function to process the messages and update the database.
  3. C
    Publish 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.
  4. D
    Route the reservation requests to Amazon EventBridge, and configure an AWS Step Functions state machine to write the updates directly to the database.

Cevap

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.

Adım Adım Çözüm

1
Analyze ordering requirements
Identify that the system requires strict first-in, first-out (FIFO) delivery to ensure reservations are processed in order and prevent overbooking.
Correctly identifying ordering requirements guides the choice between standard and FIFO services.
2
Analyze decoupling and buffering requirements
Determine that the database cannot handle sudden write spikes, requiring a queuing mechanism that supports message buffering.
Decoupling with a queue protects downstream databases from throttling and performance degradation.
3
Select the correct integration pattern
Choose Amazon SQS FIFO queue combined with AWS Lambda to process the buffered messages in order.
SQS FIFO guarantees ordering and deduplication, while Lambda consumes messages sequentially within the message group.

Anahtar Kavram

Using Amazon SQS FIFO queues to guarantee strict order processing and decouple components under heavy load.
Tahmini Süre:1m 30s
Bu soruyu puanla