A medical device manufacturer is building an IoT monitoring system on AWS to process state-change logs from thousands of diagnostic devices. The system must process status updates for each device chronologically to maintain an accurate device history. During peak usage, the system experiences brief, massive spikes in telemetry messages. The architecture must fan out these state-change events to two distinct backend systems: a real-time status-tracking service and a historical compliance auditing database. Which solution meets these requirements with the least operational overhead?
- APublish the state-change events to a standard Amazon SNS topic. Subscribe two standard Amazon SQS queues to the topic, and configure the consumer applications to re-order the events chronologically using the message timestamps.
- BPublish the state-change events to an Amazon SNS FIFO topic. Subscribe one Amazon SQS FIFO queue for the status-tracking service, and subscribe the compliance auditing database's AWS Lambda function directly to the SNS FIFO topic.
- Publish the state-change events to an Amazon SNS FIFO topic. Subscribe two Amazon SQS FIFO queues to the topic, with one queue dedicated to the status-tracking service and the other to the compliance auditing database.Answer
- DPublish the state-change events to an Amazon Kinesis Data Stream. Configure a single AWS Lambda function to run continuously in a loop to poll the stream, process the events, and write them sequentially to both downstream services.
Answer
Publish the state-change events to an Amazon SNS FIFO topic. Subscribe two Amazon SQS FIFO queues to the topic, with one queue dedicated to the status-tracking service and the other to the compliance auditing database.
Publishing events to an Amazon SNS FIFO topic and subscribing two Amazon SQS FIFO queues is the optimal decoupling pattern. SNS FIFO topics preserve message ordering and deliver messages to subscribed SQS FIFO queues in a first-in, first-out manner. The device ID is mapped to the message group ID, ensuring messages for the same device are processed in order by the downstream consumers. This fully managed approach requires no custom polling logic, keeps operational overhead to a minimum, and handles traffic spikes seamlessly.
Step-by-Step Solution
Key Concept
Decoupling with FIFO ordering and fan-out.
Estimated Time:3m 0s