Soru

Zorluk: OrtaDecoupling Architectures and Event-Driven Messaging

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?

  1. A
    Send 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.
  2. B
    Write transaction updates directly to an Amazon DynamoDB table configured in provisioned capacity mode, using an AWS Lambda function to buffer updates when throttling occurs.
  3. 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
  4. D
    Send 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

1
Analyze the requirement for message ordering and traffic buffering.
The platform needs a buffer to absorb spikes in transactional traffic and must process updates chronologically per concert.
This indicates that a FIFO queueing mechanism is required to decouple the application layers.
2
Select the appropriate queuing service and configuration.
Amazon SQS FIFO is selected because it guarantees strict ordering and deduplication.
SQS standard queues cannot be used because they do not guarantee message order.
3
Determine the message grouping strategy.
Use the concert ID as the Message Group ID.
This guarantees that transactions for the same concert are processed sequentially, while transactions for different concerts can be scaled and processed in parallel.
4
Identify the low-overhead consumer mechanism.
Configure AWS Lambda to poll the queue natively as an event source.
Lambda automatically handles integration, polling, and scaling with minimal operational management.

Anahtar Kavram

Decoupling message flows with order preservation using Amazon SQS FIFO queues and AWS Lambda.
Bu soruyu puanla