Google Cloud Pub/Sub
Google Cloud’s serverless messaging service: fan-out across subscriptions, work sharing within each one.
- What it is
- Pub/sub
- Used for
- Message queues,Event streams
- Type
- Managed service on Google Cloud
- Made by
- Google Cloud
- License
- Proprietary
- Facts checked
- 5 October 2026
What it is
A publisher sends messages to a topic. Every subscription attached to the topic gets each message, and inside one subscription the messages are spread across however many clients are pulling, each acknowledged on its own. So the same product covers fan-out (one subscription per consumer) and work queues (many workers on one subscription). An unacknowledged message is sent again after the ack deadline (10 seconds by default, up to 600) and kept for 7 days by default, 31 at most. Messages can be up to 10 MB.
Subscriptions come in several types: pull, push to an HTTPS endpoint, and export subscriptions that write straight into BigQuery, Cloud Storage or (in preview) Bigtable. Optional features include ordering keys (messages with the same key arrive in order, up to 1 MBps per key), exactly-once delivery for pull subscribers in the same region, dead-letter topics, attribute filters, and seeking a subscription back to a timestamp or snapshot to replay messages. There are no partitions or shards to plan.
Why teams pick it
- No partitions, shards or brokers: throughput scales without capacity planning
- Fan-out and competing consumers in one model
- Export subscriptions load BigQuery tables or Cloud Storage files with no code
- Replay by seeking to a timestamp or snapshot, within the retention window
Watch out for
- Ordering is opt-in, per ordering key, and capped at 1 MBps per key
- Exactly-once delivery works only for pull subscriptions in the same region; push and export subscriptions are at least once
- Filters match attributes only, not the message body, and can’t be changed after the subscription is created
- Retention tops out at 31 days, so it isn’t a long-term event log
Alternatives
What all pub/sub have in common →How it fits with other technologies
What Google Cloud Pub/Sub uses
What uses Google Cloud Pub/Sub
- Google Cloud Runcan be triggered by push subscriptions inGoogle Cloud Pub/Sub
- Quix Streamsreads from and writes toGoogle Cloud Pub/Sub
- HiveMQforwards MQTT messages toGoogle Cloud Pub/Sub
- Google Cloud Storagesends object-change notifications toGoogle Cloud Pub/Sub
- CockroachDBstreams changefeeds toGoogle Cloud Pub/Sub
- Flociemulates the API of (floci-gcp)Google Cloud Pub/Sub
One topic, a worker subscription and a BigQuery export · bash
gcloud pubsub topics create orders
# workers share this subscription; each message goes to one of them
gcloud pubsub subscriptions create billing --topic=orders \
--ack-deadline=60 --enable-exactly-once-delivery
# a second subscription gets its own copy of every message
gcloud pubsub subscriptions create orders-to-bq --topic=orders \
--bigquery-table=acme-shop:analytics.orders_raw
gcloud pubsub topics publish orders --message='{"orderId": 42}' --attribute=status=paid
gcloud pubsub subscriptions pull billing --limit=10 --auto-ackSee it in a real stack
No architecture uses Google Cloud Pub/Sub yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2015–2026
Google’s own products, including Ads, Search and Gmail, pass messages through a shared internal publish/subscribe system that, by Google’s account, carries over 500 million messages per second, more than 1 TB/s of data. Cloud Pub/Sub is that infrastructure offered as a public service. Gregor Hohpe, co-author of Enterprise Integration Patterns, wrote that he had seen “some of the humble beginnings” while working at Google.
Google opened a public beta in March 2015 and made it generally available alongside Cloud Dataflow that August, at up to 1 million message operations per second. Hohpe singled out its central idea: separating topics from subscriptions gives both publish-subscribe and point-to-point channels “through a single API.”
Pub/Sub has since taken over jobs that used to need separate pipelines: subscriptions that write straight into BigQuery, exactly-once delivery for pull subscribers, and in 2026 transforms that send messages through Vertex AI models in flight.
Why it’s built this way
- Topics and subscriptions as separate objects
- Each subscription is its own queue fed by the topic, so one model covers fan-out (many subscriptions) and work sharing (many clients on one subscription).
- No partitions or shards
- Messages flow through many forwarder servers that Google scales automatically, so users never plan partitions. Ordering is therefore opt-in, per ordering key, rather than built into a log.
- Push and pull from the start
- Subscribers can pull messages or have them pushed to an HTTPS endpoint like a webhook, which suits both long-running workers and serverless code.
- At-least-once by default
- In 2015 it usually delivered messages exactly once and in order but didn’t promise to. Exactly-once delivery came in 2022 by moving delivery state from memory into a persistent layer, at the cost of higher latency and only within one region.
Timeline
- 2015
Public beta in March; generally available in August with Cloud Dataflow
- 2022
BigQuery subscriptions in July; exactly-once delivery GA in December
- 2024
Import topics pull data in from Amazon Kinesis Data Streams
- 2025
Single Message Transforms reach general availability
- 2026
Vertex AI inference transforms; Bigtable export subscriptions in preview
- Google Cloud docs: Pub/Sub architectural overview
- Google Cloud Platform Japan blog: Cloud Pub/Sub beta (Mar 2015)
- Google Cloud Platform blog: General availability of Cloud Dataflow and Cloud Pub/Sub (Aug 2015)
- Gregor Hohpe: Google Cloud Pub/Sub (2015)
- Pub/Sub release notes: BigQuery subscriptions (Jul 25, 2022)
- Google Cloud blog: Pub/Sub exactly-once delivery is GA (Dec 2022)
- Pub/Sub release notes: Amazon Kinesis Data Streams import topics (Apr 2024)
- Pub/Sub release notes: Single Message Transforms GA (Jun 2025)
- Pub/Sub release notes: AI Inference SMT for Vertex AI models (Apr 2026)
- Pub/Sub release notes: Bigtable subscriptions in preview (Apr 2026)
Sources10 · facts checked 5 October 2026
- Google Cloud docs: Pub/Sub quotas and limits
- Google Cloud docs: Choose a subscription type
- Google Cloud docs: Subscription properties
- Google Cloud docs: Exactly-once delivery
- Google Cloud docs: Order messages
- Google Cloud docs: Dead-letter topics
- Google Cloud docs: Filter messages from a subscription
- Google Cloud docs: Replay and purge messages with seek
- Google Cloud docs: BigQuery subscriptions
- Google Cloud docs: Migrate from Kafka to Pub/Sub (no partitions, autoscaling)
