Question

Difficulty: MediumDecoupling Architectures and Event-Driven Messaging

A financial company is building a transaction ledger application where users deposit and withdraw funds. The application must process these transaction events in the exact order they occur to prevent incorrect balances. Additionally, a compliance service and an auditing service must both receive a copy of every transaction event in near-real-time. If a transaction fails to process after five attempts, it must be moved to a separate queue for analysis without blocking subsequent transactions.

Which combination of steps should a solutions architect take to meet these requirements with the least operational overhead? (Select TWO.)

  1. Create an Amazon SNS FIFO topic to receive the transaction events, and subscribe two Amazon SQS FIFO queues to the topic to fan out the events to both the compliance and auditing services.Answer
  2. Configure a redrive policy on each Amazon SQS FIFO queue to send failed transaction events to an Amazon SQS FIFO dead-letter queue (DLQ).Answer
  3. C
    Create an Amazon SNS standard topic to receive the transaction events, and subscribe two Amazon SQS standard queues to fan out the events to both services.
  4. D
    Configure a redrive policy on the Amazon SQS queues to route failed transaction events to an Amazon SQS standard dead-letter queue (DLQ).
  5. E
    Create a single Amazon SQS standard queue and use Message Group IDs to segregate the events for the compliance and auditing services while maintaining ordering.

Answer

Create an Amazon SNS FIFO topic to receive the transaction events, subscribe two Amazon SQS FIFO queues to the topic, and configure a redrive policy on each SQS FIFO queue to send failed events to an SQS FIFO dead-letter queue (DLQ).
To process transaction events in strict chronological order and distribute them to multiple independent services, you must use Amazon SNS FIFO combined with Amazon SQS FIFO. SNS FIFO distributes messages in a first-in, first-out order to multiple subscribed SQS FIFO queues. Additionally, to handle processing failures without stalling the entire queue (head-of-line blocking), a redrive policy must be configured on the SQS FIFO queues to send failed messages to an SQS FIFO dead-letter queue (DLQ). This combination ensures both strict ordering and resilient decoupling.

Step-by-Step Solution

1
Select the messaging components that support strict ordering and publish-subscribe fan-out.
Amazon SNS FIFO and Amazon SQS FIFO are selected.
Standard SQS and SNS do not guarantee first-in, first-out (FIFO) ordering. SNS FIFO allows publishing to a single topic and fanning out to multiple SQS FIFO queues while preserving message order.
2
Design the fan-out architecture by subscribing SQS FIFO queues to the SNS FIFO topic.
Two SQS FIFO queues (one for compliance and one for auditing) are subscribed to the SNS FIFO topic.
This decoupled setup ensures both downstream services receive their own copy of all events in the correct sequence without interfering with each other.
3
Implement error handling for failed messages that preserves ordering requirements.
A redrive policy pointing to an SQS FIFO Dead-Letter Queue (DLQ) is configured.
An SQS FIFO queue requires its DLQ to also be a FIFO queue. This allows failed events to be isolated after five attempts without blocking the remaining transaction events in the main queue.

Key Concept

Decoupling event-driven architectures with ordering guarantees using SNS FIFO, SQS FIFO, and FIFO Dead-Letter Queues.
Rate this question