Soru

Zorluk: OrtaDecoupling Architectures and Event-Driven Messaging

A company is designing a web-based educational testing platform. When a student submits an exam, the platform must process the submission asynchronously to calculate the score, generate a PDF certificate, and send an email notification. The grading service must process the answers in the exact order they were submitted by the student to prevent concurrency issues, and multiple backend microservices must receive the submission events independently. Which solution meets these requirements with the least operational overhead?

  1. A
    Publish the exam submission events to an Amazon SNS standard topic. Subscribe separate Amazon SQS standard queues for the grading, certificate, and notification services to the SNS standard topic.
  2. B
    Publish the exam submission events to an Amazon SNS standard topic. Subscribe separate Amazon SQS FIFO queues for the grading, certificate, and notification services to the SNS standard topic.
  3. Publish the exam submission events to an Amazon SNS FIFO topic. Subscribe separate Amazon SQS FIFO queues for the grading, certificate, and notification services to the SNS FIFO topic.Cevap
  4. D
    Publish the exam submission events to a single Amazon SQS standard queue, and configure the consumer services to poll the queue and filter for their respective message types.

Cevap

Publish the exam submission events to an Amazon SNS FIFO topic. Subscribe separate Amazon SQS FIFO queues for the grading, certificate, and notification services to the SNS FIFO topic.
The correct solution uses an Amazon SNS FIFO topic subscribed to by multiple Amazon SQS FIFO queues. An SNS FIFO topic ensures that message ordering is preserved during fan-out, and SQS FIFO queues guarantee that the consumer microservices process the messages in the exact order they were published. This satisfies both the decoupling/fan-out requirement and the strict message ordering constraint with minimal operational overhead.

Adım Adım Çözüm

1
Identify the fan-out requirement where multiple distinct services (grading, certificate, and notification) need to process the same exam submission event.
Amazon SNS is the standard AWS service to achieve event fan-out to multiple subscribers.
It allows a single published message to be delivered to multiple downstream endpoints automatically.
2
Analyze the ordering requirement which specifies that events must be processed in the exact order they are received to prevent concurrency issues.
Both the message delivery (SNS) and queueing (SQS) layers must support First-In-First-Out (FIFO) ordering.
Standard SNS and SQS queues only provide best-effort ordering, which can result in out-of-order execution.
3
Select the integration pattern that natively supports both fan-out and ordered delivery with minimal operational overhead.
Combine Amazon SNS FIFO with Amazon SQS FIFO queues.
SNS FIFO topics can deliver messages to SQS FIFO queues while preserving the message order and message group ID, eliminating the need for custom ordering or filtering logic in application code.

Anahtar Kavram

Decoupling event-driven architectures with ordering guarantees using SNS FIFO and SQS FIFO fan-out pattern.
Tahmini Süre:1m 30s
Bu soruyu puanla