Compare / Pub/Sub vs Cloud Tasks

Pub/Sub vs Cloud Tasks

Both decouple work with asynchronous messages. Pub/Sub broadcasts events to any number of subscribers. Cloud Tasks queues individual tasks for one target and gives you control over when and how fast they are delivered.

In 4 practice questions across 3 practice banks

Professional Cloud Developer Application Design

You are a developer that works for a local concert venue. Customers use your company’s website to purchase tickets for events. You need to provide customers with immediate confirmation when a selected seat has been reserved. How should you design the ticket ordering process?

  1. Bucket events are asynchronous — no immediate confirmation.

  2. A synchronous POST returns the reservation outcome in-line.

  3. Cloud Tasks+Workflows is queued async work.

  4. Pub/Sub is fire-and-forget — the user waits without confirmation.

Pick an answer to see why each option is right or wrong.

Try 20 questions free

At a glance

Pub/SubCloud Tasks
PatternPublish/subscribe: one event, many consumersTask queue: each task goes to one handler
Delivery controlPush or pull; subscribers set their paceRate limits, scheduling and retries per queue
Publisher knowledgePublisher does not know who consumesProducer names the target endpoint
Typical useEvent streams, fan-out, streaming pipelinesBackground jobs, throttled calls to an API

Choose Pub/Sub when

  • Several independent services must react to the same event.
  • You ingest event streams for analytics or Dataflow.
  • Producers and consumers should not know about each other.

Choose Cloud Tasks when

  • You need to throttle calls to a backend or third-party API.
  • Tasks must run at a scheduled time or with explicit retries.
  • Each piece of work has exactly one handler.

Exam tip

Fan-out to many subscribers means Pub/Sub; rate-limited or scheduled delivery to one service means Cloud Tasks.

Practice banks covering this comparison

Counts match names or aliases from both sides of the comparison in question text or answer options, including incorrect options. They do not measure how often a decision appears on the official exam.