Conceptly
← All Concepts
📡

Google Cloud Pub/Sub

IntegrationAsynchronous Messaging Service

Google Cloud Pub/Sub is a fully managed messaging service for asynchronous communication between services. It decouples publishers from subscribers to reduce system coupling and auto-scales to millions of messages per second.

Architecture Diagram

🔗 Relationship

Dashed line animations indicate the flow direction of data or requests

Why do you need it?

When multiple services call each other directly, a slowdown in one causes the caller to block. As services multiply, the call graph grows complex and failures cascade across the system.

Why did this approach emerge?

As microservice architectures spread, the coupling problem of direct service-to-service calls became more apparent. A fully managed service was needed to enable asynchronous communication without the burden of running message queues (RabbitMQ, Kafka) yourself.

How does it work inside?

Pub/Sub consists of Topics and Subscriptions. When a publisher sends a message to a Topic, it's copied to each Subscription for subscribers to Pull or receive via Push. Messages are retained until the subscriber acknowledges them.

What is it often confused with?

Pub/Sub and direct HTTP calls are both inter-service communication, but HTTP is synchronous and requires the receiver to be alive. With Pub/Sub, messages persist even if the receiver is temporarily down. Use HTTP when you need an immediate response; use Pub/Sub when you need asynchronous processing and fault tolerance.

When should you use it?

Ideal for event-driven microservices, real-time data pipelines, async task queues, and fan-out patterns. Not the right fit when strict message ordering is required or when immediate responses are needed.

Event-driven architectureStreaming data ingestionTask queuesFan-out