← Blog

Event-driven fan-out with SNS and SQS

The SNS → SQS fan-out pattern lets you publish one message and have multiple independent consumers process it without knowing about each other. In this project: when a user saves their profile, the API publishes a single `user-profile-updated` event to an SNS topic. Two SQS queues subscribe: - ImageProcessingQueue — triggers a Lambda that crops the avatar to 300×300 and saves it to S3 - NotificationQueue — stub for a future welcome email via SES Each queue has its own retry policy and dead-letter queue, so a failure in image processing doesn't affect the notification flow.