A developer is designing a messaging architecture for an online medical clinic's appointment scheduling platform. When a patient schedules or updates an appointment, the system must broadcast this event to two downstream services:
1. A reminder service that sends SMS and email notifications to patients. This service does not require messages to be processed in order.
2. A calendar synchronization service that must process events in the exact chronological order they occurred to prevent scheduling conflicts.
Which combination of actions should the developer take to implement this architecture? (Select TWO.)
- Publish the appointment events to an Amazon SNS FIFO topic.Answer
- Subscribe an Amazon SQS FIFO queue for the calendar synchronization service and a standard Amazon SQS queue for the reminder service to the Amazon SNS FIFO topic.Answer
- CPublish the events to a standard Amazon SNS topic, subscribe a standard Amazon SQS queue for the calendar synchronization service, and set the queue's visibility timeout to 0 seconds to process messages in chronological order.
- DCreate a single AWS Lambda function subscribed directly to a standard Amazon SNS topic, and store the last processed event timestamp in the Lambda execution context's global variables to manually reorder incoming events.
- EConfigure the downstream services to pull from the queues by initializing the AWS SDK client with hardcoded AWS access keys and secret keys in the consumer application code.
Answer
To implement this architecture, the developer should publish the appointment events to an Amazon SNS FIFO topic, and subscribe an Amazon SQS FIFO queue for the calendar synchronization service and a standard Amazon SQS queue for the reminder service to the SNS topic.
The correct solution involves publishing events to an Amazon SNS FIFO topic and subscribing both an Amazon SQS FIFO queue (for the calendar service) and a standard Amazon SQS queue (for the reminder service). SNS FIFO topics preserve message ordering and support fanout to both SQS FIFO queues (which guarantee order) and standard SQS queues (which handle unordered delivery).
Step-by-Step Solution
Key Concept
Amazon SNS FIFO and SQS FIFO integration (Fanout pattern)