A logistics and supply chain enterprise is building a package tracking system. When a package's delivery status changes, three distinct downstream systems must be updated: a real-time customer tracking portal, an analytics data warehouse, and an automated customer SMS notification service. The sequence of status updates must be strictly preserved on a per-package basis to prevent displaying incorrect states (such as showing 'Delivered' before 'In Transit'). The SMS notification service occasionally experiences intermittent downtime, and its messages must be retried independently without delaying processing for the tracking portal or the data warehouse. Which architecture meets these requirements with the least operational overhead?
- APublish status updates to an Amazon SNS standard topic. Subscribe three Amazon SQS standard queues to the topic (one for each downstream system), and have each system consume messages from its respective queue.
- BPublish status updates to a single Amazon SQS FIFO queue. Configure a single AWS Lambda function triggered by the queue to sequentially call the APIs of all three downstream systems, retrying the entire execution block if the SMS service fails.
- Publish status updates to an Amazon SNS FIFO topic. Subscribe three separate Amazon SQS FIFO queues to the topic (one for each downstream system), and have each system consume messages from its respective queue.Cevap
- DPublish status updates to an Amazon Kinesis Data Stream. Configure three consumer groups using the Kinesis Client Library (KCL) to process the stream, and manually increase the shard count during SMS service outages to handle delivery backlogs.
Cevap
Publish status updates to an Amazon SNS FIFO topic. Subscribe three separate Amazon SQS FIFO queues to the topic (one for each downstream system), and have each system consume messages from its respective queue.
The solution utilizing an Amazon SNS FIFO topic fanned out to three separate Amazon SQS FIFO queues successfully meets all constraints. SNS FIFO maintains ordering across the fan-out boundary, and the SQS FIFO queues maintain strict order per message group (using the package ID as the MessageGroupId). Crucially, having separate SQS FIFO queues for each service ensures that if the SMS service goes down, messages accumulate in its specific queue and can be retried independently without blocking the tracking portal or the data warehouse.
Adım Adım Çözüm
Anahtar Kavram
Combining Amazon SNS FIFO and Amazon SQS FIFO queues in tandem allows for ordered message fan-out and decoupled consumer processing, isolating failures and retries for individual subscribers.
Tahmini Süre:2m 30s