Google Cloud Pub/Sub
Scalable, real-time messaging service for building event-driven systems
What is Cloud Pub/Sub?
Google Cloud Pub/Sub is a fully managed, real-time messaging service that allows you to send and receive messages between independent applications. It implements the publish-subscribe pattern, enabling asynchronous communication between services by decoupling senders (publishers) from receivers (subscribers).
Built on Google's global infrastructure, Cloud Pub/Sub provides reliable, many-to-many, asynchronous messaging that scales automatically to handle millions of messages per second. It serves as the backbone for event-driven architectures, stream analytics, and real-time data integration across distributed systems.
Architecture
Key Components
Topics
Named resources that act as communication channels where publishers send messages. Topics are globally unique within a project.
- • Message ordering
- • Schema validation
- • Message retention
Subscriptions
Named resources representing the stream of messages from a topic to be delivered to subscribing applications.
- • Push/Pull delivery
- • Message filtering
- • Dead letter queues
Messages
Data units that publishers send to topics and subscribers receive from subscriptions, containing payload and attributes.
- • Up to 10MB payload
- • Custom attributes
- • Message ID & timestamp
Key Capabilities
Auto-scaling
Automatically scales to handle millions of messages per second with no manual intervention required.
At-least-once Delivery
Guarantees message delivery with configurable acknowledgment deadlines and retry policies.
Push and Pull Delivery
Supports both push (webhook) and pull (polling) message delivery modes for flexible integration.
Message Filtering
Filter messages at the subscription level based on message attributes to reduce unnecessary processing.
Message Retention
Configurable message retention periods from 10 minutes to 7 days for replay and recovery scenarios.
Common Use Cases
Decouple microservices with asynchronous messaging
Real-time data processing and analytics pipelines
Push notifications and alert systems
ETL processes and data synchronization
Background job processing and work distribution
Collect and process IoT sensor data at scale
Related Topics
Test Your Knowledge
Score 8/10 or higher to pass
You need to be logged in to take this quiz.
Login to Continue