Skip to main content

Data Processing and Pipelines

Docs: Data analytics products

Services at a Glance​

ServiceTypeBest For
Pub/SubMessaging / event streamingDecoupling services, ingesting high-volume event streams
DataflowStream + batch processingManaged Apache Beam pipelines; unified streaming/batch
DataprocManaged Hadoop/SparkExisting Spark/Hadoop workloads, ML with Spark MLlib
BigQueryAnalytics data warehouseSQL analytics, reporting, ML on large datasets
EventarcEvent routingTrigger Cloud Run / Cloud Functions from GCP events
Looker / Looker StudioBI and visualisationDashboards and reports on BigQuery or other sources

Pub/Sub​

Fully managed, globally distributed messaging service. Producers publish messages to a topic; consumers receive them via a subscription.

Push vs Pull subscriptions:

  • Pull β€” consumer calls the API to retrieve messages. Suitable for batch consumers or when the consumer controls the rate.
  • Push β€” Pub/Sub delivers messages to a specified HTTPS endpoint (e.g. Cloud Run URL). Suitable for event-driven serverless architectures.

Key properties:

  • At-least-once delivery by default; exactly-once delivery available on pull subscriptions
  • Message ordering β€” enable ordering keys to guarantee ordered delivery per key
  • Dead-letter topics β€” messages that fail after N delivery attempts are forwarded to a DLT for inspection
  • Pub/Sub Lite β€” cheaper, zonal, lower durability; use only for very high throughput workloads where you can tolerate occasional message loss

Docs: Pub/Sub overview

Dataflow​

Managed execution environment for Apache Beam pipelines. The same pipeline code runs in both streaming and batch modes β€” you change the runner, not the logic.

  • Streaming β€” continuous processing of unbounded data (e.g. IoT telemetry, clickstreams)
  • Batch β€” finite dataset processing (e.g. nightly ETL, log analysis)
  • Autoscales workers based on throughput; no cluster to manage
  • Dataflow templates β€” pre-built pipelines for common patterns (Pub/Sub β†’ BigQuery, GCS β†’ BigQuery, etc.)
  • Windowing β€” group streaming events by time windows (tumbling, sliding, session) for aggregations

Use over Dataproc when: You are building new pipelines, want fully managed autoscaling, or need a unified streaming + batch model.

Docs: Dataflow overview

Dataproc​

Managed Hadoop and Spark clusters. Spin up in ~90 seconds; pay only while the cluster runs.

  • Use when: You have existing Spark or Hadoop jobs, use Spark MLlib, or need Hive, Pig, or Presto
  • Use Dataflow instead when: You are writing new pipelines and don't need the Spark ecosystem
  • Ephemeral clusters β€” spin up, run a job, shut down. More cost-effective than long-running clusters.
  • Integrates with Cloud Storage (as HDFS replacement), BigQuery, and Dataproc Metastore (Hive-compatible)

Docs: Dataproc overview

BigQuery​

Serverless, columnar analytics data warehouse. Separates compute from storage β€” you pay for queries and storage independently.

Key features:

  • Partitioning β€” divide tables by date/timestamp or integer range to reduce query cost (only relevant partitions scanned)
  • Clustering β€” sort data within partitions by one or more columns; improves filter and aggregation performance
  • Streaming inserts β€” write rows in real time (via Pub/Sub β†’ Dataflow β†’ BigQuery or direct API)
  • BigQuery ML β€” train and run ML models with SQL; no data movement to Vertex AI needed for simple models
  • External tables β€” query data in Cloud Storage, Google Sheets, or Bigtable without loading it into BigQuery

Docs: BigQuery overview

Eventarc​

Routes events from GCP services (Cloud Storage, Pub/Sub, Cloud Audit Logs, etc.) to event consumers (Cloud Run, Cloud Run Functions, GKE workflows) without custom polling or glue code.

Use when: You want to trigger a Cloud Run service when a file lands in Cloud Storage, or when a BigQuery job completes, without writing a Pub/Sub subscriber yourself.

Docs: Eventarc overview

Common Pipeline Patterns​

IoT / real-time telemetry:

Device β†’ Pub/Sub β†’ Dataflow (stream) β†’ Bigtable (low-latency reads)
β†’ BigQuery (analytics)

Batch ETL / data warehouse load:

Cloud Storage β†’ Dataflow (batch) β†’ BigQuery
Cloud Storage β†’ BigQuery load job (simpler, no transformation)

Event-driven microservices:

Service A β†’ Pub/Sub topic β†’ Pub/Sub push subscription β†’ Cloud Run (Service B)

CDC (database replication):

Cloud SQL / Postgres β†’ Datastream β†’ BigQuery (real-time analytics replica)

Exam Tips​

  • "Unified streaming and batch" β†’ Dataflow (Apache Beam)
  • "Existing Spark jobs" β†’ Dataproc
  • "High-throughput event ingestion" β†’ Pub/Sub
  • "Trigger Cloud Run on a GCS file upload" β†’ Eventarc (not a custom Pub/Sub subscriber)
  • BigQuery is not for OLTP β€” no row-level transactions, optimised for full-table scans

Official Documentation​