Pub/Sub
also: publish-subscribe
A messaging pattern where publishers broadcast events to topics and any number of subscribers receive them — sender and receiver never know each other.
Pub/sub (publish-subscribe) is a messaging pattern where publishers send messages to a named topic rather than to specific receivers, and any number of subscribers to that topic receive a copy. Publishers and subscribers are fully decoupled — neither knows the other exists — which makes it easy to add new consumers.
Worked example: an “order.placed” event is published once; the email service, the analytics service, and the inventory service each subscribe and react independently — adding a new consumer means subscribing, with zero changes to the publisher. Gotcha: unlike a point-to-point queue (one consumer per message), pub/sub fans out to ALL subscribers, so you must think about delivery guarantees per subscriber, slow consumers (backpressure), and that a replayed or duplicated event hits every subscriber — idempotent consumers still matter.