Publish-Subscribe Systems
One event, many independent listeners — without the publisher needing to know who's listening or how many there are.
Intermediate
| Component | Role |
|---|---|
| Broker | Stores messages for a topic and serves both writes (from publishers) and reads (to subscribers). |
| Partition | A topic is split into multiple partitions, each an ordered, append-only log — this is what lets a topic scale write throughput horizontally, the same idea as partitioning a database or a message queue. |
| Cluster manager | Tracks which broker owns which partition, manages replication (a leader-follower model per partition), and handles failover. |
| Consumer manager | Tracks subscriber authorization and, in some designs, which offset each subscriber has consumed up to within a partition. |
| Message queue | Pub-sub | |
|---|---|---|
| Consumer relationship | Competing consumers — each message is processed by exactly one consumer in the group | Fan-out — every subscriber gets its own copy of each message |
| Typical use | Distributing units of work across a worker pool | Broadcasting an event to multiple independent, unrelated systems |
| PlateRoute example | A pool of workers processing image-resize jobs for uploaded restaurant photos | "Order placed" fanning out to Dispatch, Notification, and Analytics |