Soru

Zorluk: OrtaDecoupling Architectures and Event-Driven Messaging

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.)

  1. Create an Amazon SNS FIFO topic, and subscribe two Amazon SQS FIFO queues to the topic.Cevap
  2. Publish the trip status updates to the SNS FIFO topic using the unique trip ID as the message group ID.Cevap
  3. C
    Create a standard Amazon SNS topic, and subscribe two standard Amazon SQS queues to the topic.
  4. D
    Configure an AWS Lambda function to run continuously in a loop to poll the status updates and process them sequentially for both services.
  5. E
    Write the trip status updates to an Amazon DynamoDB table using a sequential, monotonically increasing timestamp as the partition key.

Cevap

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.

Adım Adım Çözüm

1
Determine how to broadcast trip status updates to both backend services without coupling.
Amazon SNS is chosen to fan out incoming trip status updates to multiple downstream destinations.
Publishing events to an SNS topic allows multiple independent subscriber queues to receive copies of the same event.
2
Select the appropriate queue and topic types to guarantee chronological ordering.
Configure an SNS FIFO topic and SQS FIFO queues, and publish messages using the trip ID as the message group ID.
FIFO configurations guarantee that messages within the same group are processed in the exact order they are received, while the trip ID ensures serialization is restricted per trip rather than across the entire platform.
3
Exclude alternatives that introduce bottlenecks or cost inefficiencies.
Avoid standard queues (which do not guarantee ordering), continuous Lambda loops (which inflate run-time costs), and monotonic keys in DynamoDB (which create hot partitions).
This guarantees a decoupled, resilient, cost-effective, and highly performant architecture that scales with traffic spikes.

Anahtar Kavram

Decoupled fan-out with ordering preservation using SNS FIFO and SQS FIFO queues.
Bu soruyu puanla