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
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?
-
Bucket events are asynchronous — no immediate confirmation.
-
A synchronous POST returns the reservation outcome in-line.
-
Cloud Tasks+Workflows is queued async work.
-
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 freeAt a glance
| Pub/Sub | Cloud Tasks | |
|---|---|---|
| Pattern | Publish/subscribe: one event, many consumers | Task queue: each task goes to one handler |
| Delivery control | Push or pull; subscribers set their pace | Rate limits, scheduling and retries per queue |
| Publisher knowledge | Publisher does not know who consumes | Producer names the target endpoint |
| Typical use | Event streams, fan-out, streaming pipelines | Background 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.
More comparisons
- BigQuery vs Bigtable
- Dataflow vs Dataproc
- Spanner vs Cloud SQL
- Cloud Run vs GKE
- Cloud Composer vs Workflows
- Firestore vs Bigtable
- Cloud SQL for PostgreSQL vs AlloyDB
- Shared VPC vs VPC Network Peering
- Cloud VPN vs Cloud Interconnect
- Cloud Storage classes: Standard, Nearline, Coldline or Archive?
- Cloud Run functions vs Cloud Run services
- Cloud Armor vs VPC firewall rules
- Memorystore vs Firestore
- Looker vs Looker Studio
- App Engine vs Cloud Run
- Google-managed keys vs Customer-managed keys (CMEK)
- Identity-Aware Proxy vs VPN
- Compute Engine vs GKE
- Spanner vs Bigtable
- BigQuery vs Cloud SQL
- Firestore vs Cloud SQL
- Dataproc vs BigQuery
- GKE Autopilot vs Standard: which mode to choose?
- Vertex AI vs BigQuery ML
- VPC Service Controls vs IAM
- Private Google Access vs Cloud NAT