Pub/Sub
Publish-Subscribe (Pub/Sub) is a messaging pattern that enables asynchronous, one-to-many communication between services. Unlike point-to-point queues where each message goes to a single consumer, pub/sub broadcasts messages to all interested subscribers. In system design interviews, pub/sub appears whenever you need event-driven architectures, real-time notifications, or decoupled service communication.
This page covers what you need for interviews: how pub/sub differs from message queues, the core components and design patterns, push vs pull delivery, message filtering, and how to architect a scalable pub/sub system. Understanding these concepts helps you design systems that efficiently distribute events to multiple consumers without tight coupling.