You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Google Cloud Tasks is a fully managed service for executing, dispatching, and delivering tasks asynchronously. While Pub/Sub is designed for event-driven messaging between services, Cloud Tasks is designed for task execution — specifically, for situations where you need to control the rate, timing, and retry behaviour of work items sent to a target service.
Understanding when to use Cloud Tasks versus Pub/Sub is essential:
| Aspect | Cloud Tasks | Pub/Sub |
|---|---|---|
| Pattern | Task dispatch (command) | Publish-subscribe (event) |
| Consumers | One target per task | Many subscribers per topic |
| Rate control | Yes (configurable rate limits) | No (subscriber controls pace) |
| Scheduling | Yes (schedule tasks for future execution) | No (immediate delivery) |
| Deduplication | Yes (task names for deduplication) | Via exactly-once or client-side |
| Delivery | HTTP (App Engine or generic target) | Pull, push, BigQuery, GCS |
| Fan-out | No — one task, one handler | Yes — one message, many subscribers |
| Use case | "Do this later" | "This happened" |
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.