Soru

Zorluk: OrtaDecoupling Architectures and Event-Driven Messaging

An online auction platform allows users to submit bids on items. The platform must process these bids in the exact chronological sequence in which they are received to ensure that the correct winning bid is determined. Bidding activity is highly variable, with sudden spikes in traffic during the final minutes of popular auctions. The architecture must decouple the bid submission layer from the backend processing system to handle these traffic spikes without losing any bids. Which solution meets these requirements with the least operational overhead?

  1. Configure the bid submission layer to send events to an Amazon SQS FIFO queue, using the auction item ID as the message group ID. Have the backend processing system consume messages from the queue.Cevap
  2. B
    Configure the bid submission layer to send events to a standard Amazon SQS queue. Have the backend processing system consume messages from the queue.
  3. C
    Write the bidding events directly to an Amazon DynamoDB table configured in provisioned capacity mode, and use DynamoDB Streams to trigger the backend system.
  4. D
    Configure the bid submission layer to write events to an Amazon RDS database, and configure an AWS Lambda function that runs continuously to poll the database and process the bids.

Cevap

Configuring the bid submission layer to send events to an Amazon SQS FIFO queue, using the auction item ID as the message group ID, and having the backend processing system consume messages from the queue.
The correct solution uses an Amazon SQS FIFO queue to decouple the application components while guaranteeing that bids are processed in the exact order they are received. By using the auction item ID as the message group ID, the queue ensures that bids for the same auction item are processed sequentially, while bids for different items can be processed in parallel. This serverless approach minimizes operational overhead.

Adım Adım Çözüm

1
Analyze the requirements for ordering and decoupling.
The system requires strict chronological processing (ordering) and must decouple the frontend from the backend to handle sudden traffic spikes (queuing/decoupling).
This establishes the necessary AWS services (like Amazon SQS FIFO) that support both decoupling and message ordering.
2
Evaluate Amazon SQS queue types.
Amazon SQS FIFO queues guarantee that messages are processed in the exact order they are received, whereas standard SQS queues only offer best-effort ordering.
This rules out standard SQS queues, which could process bids out of order.
3
Determine the partition/grouping strategy and operational overhead.
Using the auction item ID as the message group ID in SQS FIFO allows parallel processing across different auctions while maintaining strict ordering within each auction, with minimal operational overhead.
This ensures both ordering correctness and high performance without the overhead of managing stream shards or database polling loops.

Anahtar Kavram

Decoupling message queues with ordering guarantees (SQS FIFO)
Tahmini Süre:1m 30s
Bu soruyu puanla