Question

Difficulty: MediumDecoupling Architectures and Event-Driven Messaging

A logistics company is designing an automated warehouse inventory synchronization system. When items are scanned at receiving stations, inventory update events are generated. These events must be delivered to three separate systems: a centralized inventory database, a third-party vendor replenishment system, and a real-time shipping analytics dashboard. The centralized inventory database must process the events in the exact chronological order they were generated to avoid reconciliation errors, whereas the other systems can process events in any order. If any downstream system is unavailable, it must not impact the others, and the failed events must be retried automatically. Which solution meets these requirements with the least operational overhead?

  1. Publish the inventory update events to an Amazon SNS FIFO topic. Subscribe three Amazon SQS FIFO queues to the SNS FIFO topic, with each queue consuming messages for one of the downstream systems.Answer
  2. B
    Publish the inventory update events to a standard Amazon SNS topic. Subscribe three standard Amazon SQS queues to the SNS topic, with each queue consuming messages for one of the downstream systems.
  3. C
    Publish the inventory update events to a single Amazon SQS FIFO queue. Configure the centralized inventory database, vendor replenishment system, and shipping analytics dashboard to poll this queue and delete messages after processing.
  4. D
    Publish the inventory update events to an Amazon Kinesis data stream. Provision a single shard and configure the three downstream systems to consume the events from the stream using the Kinesis Client Library (KCL).

Answer

Publish the inventory update events to an Amazon SNS FIFO topic and subscribe three Amazon SQS FIFO queues to it, with each queue consuming messages for one of the downstream systems.
The correct solution leverages the fan-out pattern with ordering. By publishing events to an Amazon SNS FIFO topic, the message order is preserved. Subscribing three Amazon SQS FIFO queues (one for each downstream system) ensures that each system gets its own independent copy of every event, ensuring fault isolation and automatic retries. The SQS FIFO queue bound to the inventory database guarantees that the events are processed in the exact order they were scanned, preventing race conditions or incorrect state calculations.

Step-by-Step Solution

1
Select a message fan-out service to deliver events to multiple downstream systems.
Amazon SNS is chosen because it natively supports publishing messages to multiple subscribers (fan-out pattern).
The requirement states that events must be delivered to three separate systems independently.
2
Ensure strict ordering guarantees for the centralized inventory database.
Use Amazon SNS FIFO and Amazon SQS FIFO queues.
Standard SQS/SNS do not guarantee ordering. SQS FIFO queues guarantee chronological order processing, and they can only subscribe to SNS FIFO topics.
3
Decouple downstream processing to ensure isolation and retries.
Create a separate SQS FIFO queue for each of the three downstream systems.
If any downstream system fails, its dedicated SQS queue will hold the messages for retry without affecting the other systems' queues.

Key Concept

Decoupling message fan-out with strict ordering guarantees using Amazon SNS FIFO and Amazon SQS FIFO queues.
Rate this question