Google Cloud · Comparison

Pub/Sub vs Cloud Tasks vs Eventarc

How should services on Google Cloud send work and events to each other asynchronously?

Decision summary

Use Pub/Sub when one event should reach many independent consumers or when you stream data at high throughput. Use Cloud Tasks when a producer wants a specific endpoint called later, at a controlled rate, with retries and optional scheduling. Use Eventarc when you want to react to events from Google Cloud services (a new object, an audit-logged API call) or route Pub/Sub events to Cloud Run with filters.

Best fit for each option

Pub/Sub

Fan-out events, decoupled microservices, streaming ingestion.

Cloud Tasks

Rate-limited, retried calls to one HTTP target; delayed or scheduled tasks.

Eventarc

Reacting to Google Cloud service events and routing events to Cloud Run and functions.

Side by side

 Pub/SubCloud TasksEventarc
Best forOne-to-many messagingOne-to-one controlled deliveryEvent routing from services
ScalingVery high throughput, globalPer-queue dispatch rate limitsScales with event sources
Operational complexityTopics and subscriptions; idempotent consumersQueues with rate and retry settingsTriggers with filters
AvailabilityAt-least-once delivery, retention and replayRetries with backoffDelivery through Pub/Sub with retries

When to avoid each option

Pub/Sub

  • Strict per-endpoint rate limiting or scheduled delivery of individual tasks.

Cloud Tasks

  • Broadcasting one event to many consumers.

Eventarc

  • High-throughput messaging between your own services, where Pub/Sub directly is simpler.

Example scenarios

SituationChooseWhy
An order event must reach billing, email and analyticsPub/SubEach consumer gets its own subscription.
Send emails through a provider limited to 50 requests per secondCloud TasksQueue rate limits protect the provider.
Generate a thumbnail when an image is uploadedEventarcA Cloud Storage event triggers a Cloud Run service.

Exam cues

  • Decouple and fan out: Pub/Sub. Rate-limited calls to an endpoint: Cloud Tasks.
  • React to Cloud Storage or audit-log events: Eventarc.

Service pages

Related

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake