AWS Certified Cloud Practitioner (CLF-C02)Cloud Technology and ServicesHard
A company needs to send a single event notification to multiple independent systems (an email alert, a Lambda function, and an SQS queue) simultaneously when a new order is placed. Which architecture pattern should they implement?
- AUse SNS to publish to a topic with multiple subscribers (fan-out pattern)
- BUse a single SQS queue with multiple consumers polling it
- CUse CloudWatch Events to trigger only the Lambda function
- DUse one Lambda function to sequentially call each system
Show answer & explanationAnswer & explanation
Correct answer: A. Use SNS to publish to a topic with multiple subscribers (fan-out pattern)
The SNS fan-out pattern publishes a single message to a topic, which then delivers it to multiple independent subscribers (email, Lambda, SQS) simultaneously and in parallel, decoupling the producer from consumers.
Why the other options are wrong
- B. A single SQS queue delivers each message to only one consumer at a time, not simultaneously to multiple independent systems.
- C. CloudWatch Events alone wouldn't handle email and SQS delivery in a decoupled fan-out manner.
- D. Sequential calls from Lambda create tight coupling and a single point of failure, unlike a fan-out pattern.
SNS Fan-Out Pattern
An architecture where an SNS topic publishes a message to multiple subscribers (SQS, Lambda, email, etc.) simultaneously, enabling decoupled parallel processing.
- One message, multiple subscriber types
- Decouples producers from consumers
- Common subscribers: SQS, Lambda, HTTP, email
Memory trick: SNS fans out the message like a megaphone to many ears