Kafka · Core Concepts

Kafka vs cloud Pub/Sub (e.g. Google Pub/Sub)

Easypubsubcomparisonmanagedoffsetscloud

Interview question

How does Apache Kafka compare to a managed Pub/Sub system like Google Cloud Pub/Sub?

How to answer

The short answer

Both are publish/subscribe messaging systems. The difference is model, control, and ops.

Kafka

  • You (or your platform team) run a cluster of brokers (or a managed Kafka like MSK / Confluent Cloud).
  • Core abstraction: durable partitioned log with offsets.
  • Consumers pull and control pace; can replay by resetting offsets.
  • Strong story for ordering per key/, exactly-once streams, Connect, Streams.
  • More knobs: partitions, ISR, retention, , rebalances.

Cloud Pub/Sub (Google-style)

  • Fully managed service: less cluster babysitting.
  • Abstraction: topics + subscriptions.
  • Often push or pull delivery; acks are at message/subscription level rather than "log offset" thinking.
  • Excellent for serverless / GCP-native apps.
  • Replay and ordering exist, but the mental model differs from Kafka's partition log.

When interviews want contrast

ConcernLean KafkaLean Pub/Sub
Replay / log semanticsNaturalPossible, different UX
Self-managed controlHighLow (managed)
Ecosystem (Connect, Streams)RichCloud-native integrations
Multi-cloud / on-premStrongCloud-tied

Interview tip: "Both are pub/sub. Kafka is a partitioned commit log with offset-based consumers; cloud Pub/Sub is a managed topic/subscription service with less ops and a different delivery model."