A medical device company is building an IoT platform that monitors patient health metrics. The platform receives events representing critical patient state changes (e.g., 'normal', 'warning', 'critical', 'resolved') sent from wearable sensors. For each patient, these state changes must be processed in the exact order they occurred to ensure the medical dashboard displays the current clinical state. Events from different patients must be processed concurrently to handle high throughput during peak hours. Which solution meets these requirements with the least operational overhead?
- Publish the health events to an Amazon SQS FIFO queue, using the patient ID as the Message Group ID. Configure an AWS Lambda function to consume and process the messages.Answer
- BPublish the health events to an Amazon SQS Standard queue. Use the patient ID as a message attribute, and configure the consumer instances to sort the events in memory before processing.
- CPublish the health events to an Amazon Kinesis Data Stream, using the patient ID as the partition key. Configure an AWS Lambda function to process the stream with a batch size of 1.
- DPublish the health events to an Amazon SNS Standard topic. Subscribe multiple Amazon SQS Standard queues to the topic to parallelize processing, and configure consumers to process events.
Answer
Publish the health events to an Amazon SQS FIFO queue, using the patient ID as the Message Group ID. Configure an AWS Lambda function to consume and process the messages.
The correct option correctly uses an Amazon SQS FIFO queue to guarantee ordered delivery. By setting the Message Group ID to the patient ID, messages associated with the same patient are always processed in the exact order they are received, while messages for different patients are processed in parallel by the AWS Lambda function. This approach has the lowest operational overhead as it relies entirely on serverless, managed integrations.
Step-by-Step Solution
Key Concept
Using Amazon SQS FIFO queues with Message Group IDs allows per-identifier ordered processing while scaling consumer processing in parallel.