Pub/Sub Made Easy
What is Cloud Pub/Sub? - ep. 2
A ten-episode progression through topics, subscriptions, clients, endpoints, and replay
Ten 2019–2020 episodes follow a message from publication to independent subscription backlogs, delivery, acknowledgement, and replay. Examples compare push and pull consumers and connect them to serverless endpoints.
Google Cloud Tech 2 of 10
In this collection Browse 10 summaries 2 of 10
Pub/Sub connects applications through messages. A publisher sends to a named topic; each consuming application creates a subscription to receive those messages. The episode applies this model to a cat-poster shop's order, packaging, shipping, and notification services.
Key points
- Topics receive publications; subscriptions own delivery state: Publishers send messages to a named topic, while each subscription has its own backlog and acknowledgement path through push or pull 00:00–02:06(opens in a new tab).
- Separate subscriptions create fan-out: Two consumers that each need a copy use two subscriptions on the same topic; fan-in can route subscriptions from different topics toward one application 01:03–02:06(opens in a new tab).
- One event can serve different purposes: An order message goes to separate packaging and notification subscriptions. Packaging then publishes its own event for shipping and notification, rather than the order service coordinating every step directly 02:06–03:09(opens in a new tab).
- The same model supports data ingestion: Messages from applications and databases can pass through an event processor such as Dataflow for duplicate removal, ordering, or enrichment before reaching storage or notification systems 03:09–05:19(opens in a new tab).
Full video: https://www.youtube.com/watch?v=MjEam95VLiI(opens in a new tab)