Google Cloud

Pub/Sub Complete Guide: Pricing, Push vs Pull, Ordering Key, Kafka Comparison

2026-05-24
NicheeLab Editorial Team

Cloud Pub/Sub is GCP's global, serverless messaging service that loosely couples publishers and subscribers. It's the core of microservice-to-microservice communication, streaming pipelines, and IoT ingestion.

Core Concepts

  • Topic: The aggregation point for messages
  • Subscription: A subscription attached to a topic (Push / Pull)
  • Publisher: The message sender
  • Subscriber: The message receiver
  • Message: Up to 10 MB of data plus attributes
  • Ack Deadline: Processing grace period (default 10 s, up to 600 s)

Push vs Pull Comparison

ItemPushPull
DeliveryPub/Sub -> HTTPS endpointSubscriber fetches
ScalingControlled on the endpoint sideParallelized by subscriber count
Main useCloud Run / Cloud FunctionsCustom apps, Dataflow
Rate controlDifficult (slow down via HTTP 429)Easy
Exactly-onceNot supportedSupported (Pull only)

Pub/Sub vs Pub/Sub Lite

ItemPub/SubPub/Sub Lite
ScalingGlobal, automaticZonal, capacity-reserved
PricingPay-as-you-go (higher)Reserved (cheaper, ~10x lower)
SLA99.95%99.5%
Main useMicroservices, IoTKafka alternative, log aggregation

Key Features

  • Ordering Key: Order guaranteed within the same key
  • Exactly-once delivery: Pull only; fully eliminates duplicates
  • Dead Letter Topic: Isolates messages that have failed n times
  • Message Retention: Up to 7 days (Lite supports up to 90 days)
  • Replay (Snapshot/Seek): Redeliver past messages
  • Schema Registry: Schema validation with Avro / Protocol Buffers
  • Filtering: Attribute-based delivery filtering on subscriptions
  • BigQuery Subscription: Writes directly to BigQuery (no Dataflow required)
  • Cloud Storage Subscription: Batches writes directly to GCS

Comparison with Other Messaging Systems

ItemPub/SubAWS SNS+SQSKafka (Confluent)
ArchitectureServerless, globalSNS + SQS separateManaged cluster
OrderingOrdering KeyFIFO QueueWithin a partition
ThroughputHighMediumHighest
Pricing$40/TBSNS $0.5/M + SQS $0.4/MVM cost + license
OperationsNoneNoneRequires management

Typical Use Cases

  • Event-driven microservice communication (Order -> Email)
  • IoT telemetry ingestion (Device -> Pub/Sub -> Dataflow -> BigQuery)
  • Streaming ETL (Pub/Sub -> Dataflow -> Spanner/BQ)
  • Log aggregation (App -> Pub/Sub -> Cloud Logging)
  • Multi-subscriber fan-out (1 Topic -> multiple Subscriptions)
  • Cross-cloud integration (Webhook -> Pub/Sub -> AWS Lambda)

Should I choose Push or Pull?

Push delivers directly to an HTTPS endpoint (Cloud Run / Functions); Pull lets the subscriber fetch messages actively. Pull wins on scaling flexibility, Push wins on simplicity.

How does it differ from Pub/Sub Lite?

Standard Pub/Sub is serverless, global, and auto-scaled; Pub/Sub Lite uses reserved zonal capacity and is roughly 10x cheaper. Lite is a candidate Kafka replacement.

What is an Ordering Key?

Messages sharing the same key are delivered in order. Different keys are processed in parallel; within a key, order is preserved. Essential for use cases like chat messages.

Is exactly-once delivery possible?

Yes, with a Pull subscription and exactly-once enabled. Duplicates are fully eliminated at the cost of slightly higher latency.

What is a Dead Letter Topic?

A mechanism that forwards messages a subscriber has failed n times to a separate topic. Essential for isolating and reprocessing problematic messages.

How does it compare to AWS SNS/SQS and Kafka?

Pub/Sub unifies SNS (pub/sub) and SQS (queue). Versus Kafka, it wins on serverless, global, auto-scaling; Kafka still leads on raw throughput.

What is the pricing model?

Billed on ingest + delivery data volume ($40/TB). Pub/Sub Lite is billed per reserved throughput unit. Includes a 10 GB monthly free tier.

Is there a Schema Registry?

Yes, Pub/Sub Schemas supports Avro and Protocol Buffers schemas, guaranteeing schema consistency between publishers and subscribers.

Related Articles: Messaging / Data

Pub/Sub vs Kafka vs Kinesis 徹底比較|ストリーミングメッセージング選び方 (2026)

Google Pub/Sub / Apache Kafka (Confluent / MSK) / AWS Kinesis の徹底比較。料金、Throughput、順序保証、Exactly-once、Schema Registry、Push vs Pull、典型ユースケースを 2026 年最新版で網羅。

GCP vs AWS ストレージ・DB 徹底比較|GCS/S3・BigQuery/Redshift・Spanner/DynamoDB (2026)

GCP と AWS のストレージ・データベースを徹底比較。Cloud Storage vs S3、BigQuery vs Redshift、Spanner vs DynamoDB / Aurora DSQL、Cloud SQL vs RDS、AlloyDB vs Aurora、Firestore vs DynamoDB、Bigtable vs DynamoDB を 2026 年最新版で網羅。

GCP vs AWS コンピュート徹底比較|EC2/GCE・GKE/EKS・Lambda/Cloud Run・料金 (2026)

GCP と AWS のコンピュートサービスを徹底比較。Compute Engine vs EC2、GKE vs EKS、Cloud Run vs Lambda、App Engine vs Elastic Beanstalk、GPU/TPU、Arm 系 (Axion vs Graviton)、料金体系・Sustained Use Discount を 2026 年最新版で網羅。

GCP Professional Cloud Developer (PCD) 完全ガイド|Cloud Run・GKE・CI/CD・APM

Google Cloud Professional Cloud Developer の試験範囲、Cloud Run / GKE / Cloud Build / Cloud Trace、AWS DVA / Azure AZ-204 比較、学習ロードマップを徹底解説。

Google Cloud is a trademark of Google LLC. For the latest information, see the Pub/Sub official docs.

Check what you learned with practice questions

Practice with certification-focused question sets

View GCP exam prep page
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Google Cloud

Google Cloud Certification Roadmap (2026)

Choose your GCP certification path — Foundational, Associate...

Google Cloud

CDL Cloud Digital Leader: Complete Exam Guide (2026)

Pass the Cloud Digital Leader exam — cloud business value, G...

Google Cloud

GAIL Generative AI Leader: Complete Exam Guide (2026)

Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...

Google Cloud

Vertex AI Fundamentals for GCP Certs (2026)

Vertex AI basics every cert candidate needs — Workbench, Pip...

Google Cloud

Associate Cloud Engineer (ACE): Complete Guide (2026)

Pass the Associate Cloud Engineer exam — Console, gcloud, pr...

Browse all Google Cloud articles (103)
© 2026 NicheeLab All rights reserved.