concept Cloud Pub / Sub in category cloud

This is an excerpt from Manning's book Google Cloud Platform in Action.
Although the idea of a single function on its own isn’t all that exciting, the glue that brings these functions together is what makes them special (see figure 12.3). In the typical flow of an application, most requests are triggered by users making requests, usually over HTTP (for example, a user somewhere logs in to your app). In the world of Cloud Functions, other types of events from lots of different cloud services can trigger requests (in addition to regular HTTP requests). For example, a function can be triggered by someone uploading a file to Cloud Storage or a message being published via Cloud Pub/Sub.
Once Cloud Pub/Sub receives the message, it’ll assign the message an ID that’s unique to the topic and will return that ID to the producer as confirmation that it received the message (figure 21.1). Think of this flow as a bit like calling an office and the receptionist saying, “I’ll be sure to pass along the message.”
Now that the message has arrived at Cloud Pub/Sub, a new question arises: who’s interested in this message? To figure this out, Cloud Pub/Sub uses a concept of subscriptions, which you might create to say, “I’d like to get messages about this topic!” Specifically, Cloud Pub/Sub looks at all of the subscriptions that already exist on the topic and broadcasts a copy of the message to each of them (figure 21.2). Much like a work queue, subsequent messages sent to the topic will queue up on each subscription so someone might read them later. Think of this as the receptionist photocopying each message once for each department and putting it in each inbox at the front desk.
Cloud Pub/Sub is a fully managed messaging system (like Apache Kafka) that Google built on top of its internal infrastructure because its messaging needs were similar to those of many other companies. The infrastructure that Google Cloud Pub/Sub uses is the same as the lower level infrastructure that other services internal to Google, such as YouTube and AdWords, use.