Publish–Subscribe Pattern
maang.io System Design Series
The publish–subscribe pattern decouples senders from receivers through topics: producers publish without knowing who listens, and the broker fans each message out to every subscriber. It's the shape behind event-driven architectures, notifications, and cache invalidation — and understanding push vs pull and durable vs ephemeral subscriptions is what separates a working design from a lossy one.
This deep dive comes in three parts:
- Foundations & Core Concepts — topics, fan-out, and pub/sub vs point-to-point.
- Internals — push vs pull, durable subscriptions, and filtering/routing, with worked examples.
- Interview — Staff/Principal Q&A: fan-out at scale and choosing a broker.