Design SNS-Style Pub/Sub Fanout to Millions of Subscribers

Last updated: November 29, 2026

Quick Overview

Design a managed publish/subscribe service where a publisher sends one message to a topic and it is delivered to every subscriber, which can be queues, HTTP endpoints, functions, email or mobile push, with some topics having millions of subscribers.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design a managed publish/subscribe service where a publisher sends one message to a topic and it is delivered to every subscriber, which can be queues, HTTP endpoints, functions, email or mobile push, with some topics having millions of subscribers.

An AWS-flavored design question that tests large fanout, at-least-once delivery and isolation between noisy and quiet tenants. Interviewers push on what happens when one subscriber endpoint is slow and how you avoid it delaying everyone else.

What the Interviewer Expects
  • Persist the publish durably before acknowledging
  • Expand fanout in parallel with subscription lists sharded per topic
  • Deliver at least once with retries, backoff and dead-letter queues
  • Isolate slow or failing endpoints from healthy ones
  • Support filter policies so subscribers receive only matching messages
Key Topics to Cover
Fanout
At-least-once delivery
Dead-letter queues
Tenant isolation
Filter policies
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How would you provide FIFO ordering for some topics?
  • How do you deliver to a topic with 10M mobile push subscribers within a minute?
  • How do you stop one customer's broken webhook from consuming all delivery workers?
  • How would you implement message filtering efficiently?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: create topics, subscribe endpoints with optional filter policies, publish messages up to 256 KB, deliver to each matching subscriber. Non-functional: publish is acknowledged only a...

High-Level Design
  1. Publish front end authenticates, validates, writes the message to a replicated message store (three AZs), and acks.
  2. Fanout service reads new messages, loads the topic's subscription list...

Submit Your Answer
Markdown supported