Question

Difficulty: MediumDecoupling Architectures and Event-Driven Messaging

A real estate platform allows agents to update property listing details. When a listing is updated, the platform must concurrently update the search index, regenerate watermarked images of the property, and send email alerts to prospective buyers. To prevent older data from overwriting newer updates, changes to each property listing must be processed in the exact chronological order they were submitted. The image watermarking and email alert processes do not require strict ordering but must be decoupled to handle traffic spikes.

Which solution meets these requirements with the least operational overhead?

  1. A
    Publish listing update events to a standard Amazon SNS topic. Subscribe three standard Amazon SQS queues to the SNS topic to decouple the search indexing, image watermarking, and email alert services.
  2. B
    Publish listing update events to a standard Amazon SNS topic. Subscribe one Amazon SQS FIFO queue for search indexing and two standard Amazon SQS queues for image watermarking and email alerts to the SNS topic.
  3. Publish listing update events to an Amazon SNS FIFO topic. Subscribe three Amazon SQS FIFO queues to the SNS FIFO topic, with each queue feeding one of the downstream services: search indexing, image watermarking, and email alerts.Answer
  4. D
    Publish listing update events to an Amazon SNS FIFO topic. Subscribe a single Amazon SQS FIFO queue to the topic, and configure the search indexing, image watermarking, and email alert services to consume from this single queue using different message group IDs.

Answer

Publish listing update events to an Amazon SNS FIFO topic. Subscribe three Amazon SQS FIFO queues to the SNS FIFO topic, with each queue feeding one of the downstream services: search indexing, image watermarking, and email alerts.
The correct solution uses an Amazon SNS FIFO topic to fan out events to three separate Amazon SQS FIFO queues. This pattern ensures that each downstream service (search indexing, image watermarking, and email alerts) receives its own copy of the listing update event (fan-out) and processes them in the exact order they were published (FIFO), preventing race conditions where older updates could overwrite newer listing data.

Step-by-Step Solution

1
Analyze the concurrency and ordering requirements.
The platform needs to distribute listing updates to three downstream services (fan-out) while maintaining the chronological sequence of updates per property listing (ordering).
This determines that standard publish-subscribe messaging is insufficient because it does not guarantee first-in, first-out (FIFO) delivery, which is required to prevent older updates from overwriting newer ones.
2
Determine the appropriate AWS messaging integration pattern.
To implement fan-out with strict ordering, the solution must pair Amazon SNS FIFO with Amazon SQS FIFO.
An SNS FIFO topic preserves the order of messages published to it and delivers them to subscribed SQS FIFO queues in that same order. Each service needs its own SQS FIFO queue to avoid destructive reads.
3
Evaluate the subscription configuration constraints.
Subscribing SQS FIFO queues to an SNS FIFO topic ensures message ordering is preserved from end to end.
If standard SNS or standard SQS is introduced anywhere in the pipeline, ordering guarantees are lost, and subscribing a single queue to multiple consumers would prevent all services from receiving every update.

Key Concept

End-to-end first-in, first-out (FIFO) ordering in a fan-out architecture using Amazon SNS FIFO and Amazon SQS FIFO.
Estimated Time:1m 30s
Rate this question