Question

Difficulty: EasyDecoupling Architectures and Event-Driven Messaging

A company is building an online auction application where users submit bids in real time. The backend database experiences write performance issues during high-traffic spikes at the end of auctions. To ensure fairness, the bids must be processed in the exact order they are received by the application. A solutions architect needs to design a decoupled architecture that buffers incoming bids and processes them sequentially. Which solution meets these requirements with the least operational overhead?

  1. A
    Send the incoming bids to an Amazon SQS Standard queue and configure the backend service to consume and process the messages sequentially.
  2. B
    Write the incoming bids directly to an Amazon RDS Read Replica to buffer the write traffic before replicating the data to the primary database.
  3. Send the incoming bids to an Amazon SQS FIFO queue and configure the backend service to consume and process the messages sequentially.Answer
  4. D
    Configure a continuous, long-running AWS Lambda function to poll the application servers and write the bids directly to the primary database.

Answer

Send the incoming bids to an Amazon SQS FIFO queue and configure the backend service to consume and process the messages sequentially.
The correct solution uses an Amazon SQS FIFO queue to buffer incoming write requests (bids) and ensure they are processed in the exact order they are received. SQS FIFO queues guarantee first-in, first-out delivery and exactly-once processing, which is required for determining the auction winner fairly, while decoupling the frontend from the database to handle traffic spikes.

Step-by-Step Solution

1
Identify the key requirements from the scenario.
The solution must decouple the application from the database, handle write spikes, and process bids in the exact order they are received.
This establishes the constraints that any valid architecture must satisfy.
2
Evaluate the messaging service that provides decoupling and order preservation.
Amazon SQS FIFO (First-In-First-Out) queues guarantee that messages are processed in the exact order they are sent, while also providing a buffer to decouple the frontend from the backend database.
Standard queues do not guarantee ordering, making FIFO the correct choice for ordering requirements.
3
Eliminate options that do not support writes or decouple the architecture effectively.
RDS Read Replicas cannot accept writes, and a continuous Lambda function violates serverless design principles and fails to provide reliable buffer-based decoupling.
This confirms that the SQS FIFO queue is the only solution that meets all constraints with minimal operational overhead.

Key Concept

Decoupling with ordered messaging using Amazon SQS FIFO queues
Rate this question