🏗️Publish-Subscribe (Pub/Sub)
Also known as Pub/Sub, PubSub, Publish Subscribe, Topic
Send a message to a topic. All who listen get a copy.
Think of it like
Think of it like a radio station. It sends one show, and everyone tuned in hears it.
Example
Lucy's app publishes user signed up to a topic. The email service, the stats service and the welcome gift service each get a copy and act on it.
Why it matters
One event can start many jobs. New listeners can join without a change to the sender.
Definition
Common mistake
Key takeaways
- 1Send to a topic. Not to a person.
- 2Everyone gets a copy. Each subscriber.
- 3Sender stays blind. Who listens is not its business.