Pub/sub
A messaging model where the publisher sends to a topic and every subscriber of that topic gets a copy.
Example
1 «new order» message on a topic with 3 subscribers reaches email, stock and billing.
Test yourself: Pub/sub
Publish-subscribe
In pub/sub, who gets a message published to a topic?
1 message on a topic with 3 subscribers arrives 3 times, 1 to each.
Publish-subscribe
In pub/sub, the publisher needs to know who the subscribers are.
It publishes to the topic and that's it: there can be 0 or 100 subscribers and nothing changes.
Publish-subscribe
With 10 publishers and 10 subscribers, how many connections are there with pub/sub, and how many with everyone wired to everyone?
With pub/sub, each connects 1 time to the topic: 10 + 10 = 20. Without it, each publisher talks to each subscriber: 10 × 10 = 100.
0/3
â–¶ Play