A ride-hailing platform is designing an event-driven system to process trip status updates (such as requested, accepted, in-progress, and completed). These updates must be processed in the exact chronological sequence they are generated for each individual trip to ensure accurate customer billing and driver payouts. The status updates must be delivered to two separate backend services: a billing service and a real-time analytics service. The architecture must be decoupled, highly available, and handle traffic spikes dynamically.
Which combination of steps should a solutions architect take to meet these requirements? (Select TWO.)
- Create an Amazon SNS FIFO topic, and subscribe two Amazon SQS FIFO queues to the topic.Answer
- Publish the trip status updates to the SNS FIFO topic using the unique trip ID as the message group ID.Answer
- CCreate a standard Amazon SNS topic, and subscribe two standard Amazon SQS queues to the topic.
- DConfigure an AWS Lambda function to run continuously in a loop to poll the status updates and process them sequentially for both services.
- EWrite the trip status updates to an Amazon DynamoDB table using a sequential, monotonically increasing timestamp as the partition key.
Answer
Create an Amazon SNS FIFO topic and subscribe two Amazon SQS FIFO queues to it, then publish the status updates to the SNS FIFO topic using the trip ID as the message group ID.
To achieve both decoupling (fan-out) and strict chronological ordering per trip, the architect must use Amazon SNS FIFO and Amazon SQS FIFO. By subscribing two separate SQS FIFO queues (one for billing, one for analytics) to the SNS FIFO topic, the system fans out the updates to both services independently. Using the unique trip ID as the message group ID ensures that events for any single trip are processed in order, while allowing updates across different trips to run in parallel, maximizing throughput during spikes.
Step-by-Step Solution
Key Concept
Decoupled fan-out with ordering preservation using SNS FIFO and SQS FIFO queues.