Soru

Zorluk: ZorDecoupling Architectures and Event-Driven Messaging

A digital media platform is designing an event-driven news publishing system. When an editor publishes or updates an article, the system must broadcast the event to two backend services: a real-time mobile push notification service and an article search indexing service. The push notification service can process events in any order. However, the search indexing service must process updates for each article in the exact chronological sequence they were published to avoid indexing stale data. The system must automatically scale to handle traffic spikes without administrative intervention. Which combination of actions should a solutions architect take to meet these requirements? (Select TWO.)

  1. Create an Amazon SNS FIFO topic and publish article update events to it, using the article ID as the message group ID.Cevap
  2. Create two Amazon SQS FIFO queues, subscribe both queues to the SNS FIFO topic, and configure each backend service to consume from its respective queue.Cevap
  3. C
    Create an Amazon SNS Standard topic, subscribe an Amazon SQS Standard queue for the search indexing service, and configure the indexing service to use a single consumer thread to process messages in order.
  4. D
    Create an Amazon SNS FIFO topic, subscribe an Amazon SQS Standard queue for the push notification service, and subscribe an Amazon SQS FIFO queue for the search indexing service.
  5. E
    Create an Amazon SNS Standard topic, subscribe an Amazon SQS FIFO queue for the search indexing service, and configure message deduplication on the queue to maintain publisher sequence.

Cevap

Create an Amazon SNS FIFO topic with the article ID as the message group ID, and subscribe two Amazon SQS FIFO queues to it so each backend service can consume from its own dedicated queue.
To maintain message sequence across a fan-out architecture, an Amazon SNS FIFO topic must be paired with Amazon SQS FIFO queues. The SNS FIFO topic preserves the order of messages sent by the publisher, and specifying the article ID as the Message Group ID ensures that updates for the same article are processed in order. Since SNS FIFO topics only support SQS FIFO queues as subscribers, both subscription queues must be FIFO queues.

Adım Adım Çözüm

1
Analyze the fan-out and ordering requirements.
The architecture requires sending the same publishing event to multiple consumers (fan-out), where one consumer requires strict sequence ordering per article.
Identifying that a single publisher needs to distribute messages to multiple decoupled consumers helps select a publish-subscribe pattern using Amazon SNS and Amazon SQS.
2
Determine the appropriate Amazon SNS topic configuration.
Select an Amazon SNS FIFO topic and publish events using the article ID as the Message Group ID.
Standard SNS topics do not guarantee ordering. An SNS FIFO topic ensures message ordering is preserved within a message group, preventing race conditions or stale updates for a given article.
3
Identify the queue subscription requirements.
Create two Amazon SQS FIFO queues and subscribe both to the SNS FIFO topic.
Amazon SNS FIFO topics only support Amazon SQS FIFO queues as subscribers. SQS Standard queues cannot be subscribed to an SNS FIFO topic, meaning both destination queues must be FIFO to maintain end-to-end ordered delivery.

Anahtar Kavram

Amazon SNS FIFO and Amazon SQS FIFO integration for ordered message fan-out.
Tahmini Süre:2m 0s
Bu soruyu puanla