Unlock the power of your data in the cloud! Get hands-on with Google Cloud's core data services like BigQuery and Looker to validate your practical skills in data ingestion, analysis, and management, and earn your Associate Data Practitioner certification!
BigQuery subscriptions let you stream data directly from Pub/Sub into BigQuery tables without building extra pipelines. This works well for IoT devices that send constant sensor updates and for application logs that need to be searchable right away. The direct connection reduces delay because data moves from the source to your analytics table in seconds rather than minutes. BigQuery also handles different data formats automatically, so you do not have to transform the data before it arrives.
Pub/Sub tracks every message using three states. Acknowledged (acked) messages have been processed successfully and are removed from storage. Unacknowledged (unacked) messages have not been confirmed and keep being delivered until they expire or get acknowledged. Negatively acknowledged (nacked) messages tell Pub/Sub to try delivering them again immediately, which prevents data loss when something goes wrong during processing.
You can connect publishers and subscribers in three common patterns. The Fan in pattern brings data from many sources into one topic and subscription, which works well when multiple systems need to feed a single pipeline. The Load balanced pattern shares one subscription across multiple worker applications, spreading the work evenly and helping the system handle more traffic. The Fan out pattern attaches multiple subscriptions to one topic, giving each consumer its own copy of every message so different teams can process the same data in different ways.
A system architecture diagram illustrating three Pub/Sub patterns: Fan in, where multiple publishers send to one topic and one subscription; Load balanced, where one subscription distributes messages across multiple workers; and Fan out, where one topic sends copies of messages to multiple subscriptions.
Event-driven ingestion sends data through Pub/Sub as events happen and loads it into BigQuery almost immediately. Pub/Sub works asynchronously, which means the system sending the data and the system receiving it do not need to wait for each other. You create a topic to receive events and a subscription to pass them to BigQuery, and the data appears in your tables within seconds. This differs from batch loading, where you wait until you have collected a large amount of data and then load it all at once.
Real-time needs show up in several common scenarios. Streaming analytics processes user clicks, social media posts, or financial updates as they happen. Centralized logging and monitoring collects error messages and security events from many systems so teams can respond quickly. IoT data pipelines gather readings from sensors and update dashboards that show what is happening right now. Change data capture copies database updates into BigQuery so analysts always see the latest information.
Event-driven pipelines offer real advantages over batch methods. They provide low latency, often under 100 milliseconds from when an event occurs to when it appears in BigQuery. They scale automatically to handle millions of events without slowing down. They include fault tolerance through automatic retries and acknowledgments, so messages are not lost if something temporarily fails. Since publishers and subscribers work independently, you can add new consumers or remove old ones without changing the systems that produce the data.
Pub/Sub handles real-time messaging by letting publishers send messages without waiting for a response. The subscriber processes each message when it arrives rather than waiting for a batch to accumulate. This works well for user interactions like clicks and form submissions, server events that need quick attention, and continuous data streams from IoT devices. The asynchronous design means one part of your system can keep running even if another part is temporarily busy or unavailable.
Event-driven architecture shines when your workflow needs immediate results. If your team needs to see current data to make decisions, detect problems as they happen, or trigger actions right away, Pub/Sub with BigQuery delivers that speed. The system can process events from many sources at the same time and route each one to the right place without delay.
Batch processing makes more sense when speed is not critical. Some tasks, like generating monthly reports or running heavy analysis on historical data, do not need instant answers. Collecting data and processing it all at once can be more efficient for these workloads. Pub/Sub works with both approaches because it connects easily to BigQuery and Dataflow, giving you the flexibility to choose real-time processing where it matters and batch processing where it does not.
Gauge your current knowledge

Gauge your current knowledge
