Original study notes for cloud certification exams — Google Cloud first, more clouds in build.

Pub/Sub Study Notes

Pub/Sub is Google Cloud's fully managed, real-time messaging service for sending and receiving messages between independent applications. Publishers send messages to a topic, and subscribers receive them through subscriptions, which decouples producers from consumers completely. It scales automatically to handle very high message volumes and delivers messages at least once by default.

Exam tip: If an ACE scenario says decouple, fan out, or ingest streaming events with no servers to manage, Pub/Sub is almost always the service being tested.

Key facts

What the exam expects you to know

Pub/Sub vs Cloud Tasks: when to use which

Choose Pub/Sub when many consumers need to react to the same event, when order of consumers does not matter, or when you are building a streaming ingestion pipeline. Messages are published once and fanned out to every subscription. Choose Cloud Tasks when a single worker must execute a specific task, such as calling one HTTP endpoint, with control over rate, retries, and scheduled dispatch time. In short, Pub/Sub broadcasts events to whoever is listening, while Cloud Tasks dispatches individual units of work to a chosen target. Exam scenarios mentioning fan-out or streaming point to Pub/Sub. See also the Cloud Tasks notes.

Useful gcloud commands

gcloud pubsub topics create my-topic
gcloud pubsub subscriptions create my-sub --topic=my-topic
gcloud pubsub topics publish my-topic --message='hello'
gcloud pubsub subscriptions pull my-sub --limit=5

Common exam traps

Frequently asked questions

What happens if a subscriber does not acknowledge a message?

Pub/Sub waits until the acknowledgement deadline expires and then redelivers the message to an available subscriber for that subscription. This continues until the message is acknowledged, the message retention period expires, or a configured maximum delivery attempt count sends it to a dead-letter topic for separate handling and investigation.

Should I use push or pull subscriptions?

Use pull when the subscriber can control its own consumption rate and can run continuously, such as a service on Compute Engine or Google Kubernetes Engine. Use push when you want Pub/Sub to invoke a webhook or serverless endpoint automatically, and that endpoint can accept HTTPS requests, verify tokens, and return a success response quickly.

Does Pub/Sub deliver messages exactly once?

By default Pub/Sub provides at-least-once delivery, so duplicates are possible and subscribers should be idempotent. Exactly-once delivery can be enabled on pull subscriptions, which reduces duplicate processing when acknowledgements are handled correctly, but application design should still tolerate edge cases, retries, and failures outside Pub/Sub itself for full reliability.

Study aid disclaimer: Cloud Cert Notes is an independent educational study aid. It is not affiliated with, endorsed by, or sponsored by Google, Microsoft, Amazon, Oracle, or Alibaba. Google Cloud, Associate Cloud Engineer, and Cloud Digital Leader are trademarks of Google LLC; all other certification names and product names are trademarks of their respective owners. Always confirm service details against the official provider documentation before sitting an exam.