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?
- APublish 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.
- BPublish 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.
- 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
- DPublish 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
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