Question

Difficulty: HardDecoupling Architectures and Event-Driven Messaging

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?

  1. 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
  2. B
    Publish 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.
  3. C
    Publish 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.
  4. D
    Publish 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

1
Identify the ordering constraint
Events must be processed in the exact sequence they occur for each patient (per-patient ordering), but events across different patients can be processed concurrently.
This requirement determines that a message grouping mechanism is needed rather than global ordering.
2
Evaluate SQS FIFO queue capability
SQS FIFO queues guarantee order at the message group level. Using patient ID as the Message Group ID fulfills the ordering requirement for each patient while allowing parallel processing across different patients.
SQS FIFO automatically manages ordered delivery within a group and allows concurrent consumption across groups without manual partition management.
3
Compare operational overhead of alternatives
SQS Standard queues cannot guarantee ordering, necessitating complex consumer-side sorting. Kinesis Data Streams requires active shard provisioning and management. SQS FIFO with Lambda provides a fully managed serverless scaling model with the least operational overhead.
Minimizing operational overhead is a key requirement of the solution.

Key Concept

Using Amazon SQS FIFO queues with Message Group IDs allows per-identifier ordered processing while scaling consumer processing in parallel.
Rate this question