Ingesting and processing the data · Topic 1 of 4

Planning Data Pipelines on Google Cloud

Plan pipelines: sources and sinks, ETL or ELT logic and orchestration, Dataflow networking with private IPs and firewall rules, and CMEK encryption.

  • 5 min
In a nutshell
  • Choose the sink by read pattern: BigQuery for analytics, Bigtable for key lookups, Cloud Storage for files.
  • BigQuery and Cloud Storage subscriptions ingest Pub/Sub data with no pipeline code.
  • ETL when data must be changed before storage; ELT when SQL in BigQuery is enough.

What it is

Planning a pipeline means deciding where data comes from (sources), where it lands (sinks), what happens in between (transformation and orchestration logic), and the network and encryption it runs with. Getting these right first avoids pipelines that work in a test project but fail in a locked-down production network.

Sourceevents, files, databasesIngestPub/Sub, Datastream, transfersTransformDataflow, Dataproc, SQLSinkBigQuery, Bigtable, Cloud Storage

How it works

Defining sources

SourceTypical ingestion
Application or device eventsPub/Sub topic
Existing Kafka producersGoogle Cloud Managed Service for Apache Kafka, or Dataflow reading Kafka
Files from partners or other cloudsCloud Storage, via Storage Transfer Service
Operational databases (changes)Datastream change data capture
Cloud SQL, AlloyDB or Spanner data needed occasionallyBigQuery federated queries with EXTERNAL_QUERY
SaaS applicationsBigQuery Data Transfer Service

Defining sinks

Pick the sink by how the data will be read, not by how it arrives.

Read patternSink
SQL analytics, dashboards, ML in SQLBigQuery
Millisecond lookups by key at high volumeBigtable
Raw archive, data lake, files for other enginesCloud Storage
Transactions with strong consistencySpanner, Cloud SQL or AlloyDB
Further event consumersAnother Pub/Sub topic

Pub/Sub can deliver without any pipeline code: a BigQuery subscription writes messages straight into a table and a Cloud Storage subscription writes files. Use them when no transformation is needed.

Transformation and orchestration logic

ApproachMeaningFits
ETLTransform before loading (Dataflow, Dataproc, Data Fusion)Heavy cleansing, streaming, PII removed before storage
ELTLoad raw into BigQuery, transform with SQL (Dataform, scheduled queries)SQL teams, flexible reprocessing, simple sources

Orchestration logic decides order, schedule, retries and backfills. Cloud Composer handles complex DAGs across services; Workflows chains API calls cheaply; BigQuery scheduled queries and Dataform workflow configurations run SQL on a timetable.

Exam tip

If PII must never be stored in raw form, transformation must happen before the sink. That rules out ELT for that field.

Networking fundamentals

Dataflow, Dataproc and Cloud Composer run worker VMs in a VPC network you choose.

RequirementDesign
Workers must have no external IP addressesRun with private IPs only and enable Private Google Access on the subnet so workers still reach Google APIs
Workers need the internet (for example a public API) without external IPsAdd Cloud NAT
Use a central network team's subnetShared VPC: pass the full subnetwork URL
Dataflow workers must talk to each otherFirewall rule allowing TCP 12345 (streaming) and 12346 (batch) between workers; needed only for jobs that do not use Dataflow Shuffle or Streaming Engine
Stop data leaving approved projectsVPC Service Controls perimeter
Reach on-premises sourcesCloud VPN or Cloud Interconnect

Data encryption

Data is encrypted in transit and at rest by default. When the stem requires customer managed keys, set CMEK on every place data rests: the Pub/Sub topic, Dataflow job state, staging buckets and the BigQuery dataset.

python orders_pipeline.py --runner=DataflowRunner \
  --project=prod-data --region=europe-west1 \
  --subnetwork=https://www.googleapis.com/compute/v1/projects/net-host/regions/europe-west1/subnetworks/data-subnet \
  --no_use_public_ips \
  --service_account_email=df-orders@prod-data.iam.gserviceaccount.com \
  --dataflow_kms_key=projects/sec-keys/locations/europe-west1/keyRings/df/cryptoKeys/orders \
  --temp_location=gs://prod-data-temp/tmp

A worked example

A logistics firm streams truck telemetry. Dashboards need data within a minute, a routing service needs the latest position per truck in milliseconds, and raw data must be kept for five years.

The plan: devices publish to Pub/Sub; one Dataflow streaming job writes aggregates to BigQuery and latest positions to Bigtable. A Cloud Storage subscription on the same topic archives raw messages, with a lifecycle rule moving them to Archive storage. Workers use private IPs in a Shared VPC subnet with Private Google Access.

TrucksPub/SubDataflowprivate workersBigQuerydashboardsPub/Substorage subscriptionCloud Storageraw archiveDataflowlatest positionBigtablerouting lookups

How the exam asks about this

  • "Dataflow workers have no external IPs and the job cannot reach BigQuery." Enable Private Google Access on the workers' subnet.
  • "Load Pub/Sub messages into BigQuery as they are, with the least operational overhead." A BigQuery subscription on the topic.
  • "A batch Dataflow job that does not use Dataflow Shuffle, in a custom VPC, hangs when workers exchange data." Add a firewall rule allowing TCP ports 12345 and 12346 between the worker VMs.

What to remember for the exam

  • Choose the sink by read pattern: BigQuery for analytics, Bigtable for key lookups, Cloud Storage for files.
  • BigQuery and Cloud Storage subscriptions ingest Pub/Sub data with no pipeline code.
  • ETL when data must be changed before storage; ELT when SQL in BigQuery is enough.
  • Private workers need Private Google Access; internet access also needs Cloud NAT.
  • CMEK must cover every place data rests, including topics, job state and temp buckets.
Watch out

A Shared VPC subnet must be passed as a full URL including the host project. A short subnet name makes Dataflow look for it in the service project and the job fails.

Common mistakes

Choosing the sink by ingestion format. Data arriving as events can still belong in BigQuery or Bigtable; ask how it will be read.

Building a Dataflow job just to copy messages. A BigQuery subscription or Cloud Storage subscription does it without code.

Forgetting temp and staging locations. CMEK and residency rules apply to them as well.

Check yourself

  • What must be enabled for Dataflow workers without external IPs to reach Google APIs?

    Private Google Access on the subnet the workers use.

  • When is ELT a better fit than ETL?

    When raw data can be stored as is and the team transforms it with SQL in BigQuery, for example with Dataform.

  • Which sink suits millisecond lookups of the latest value per device?

    Bigtable, keyed by device ID.

Topic 1 of 4 in Ingesting and processing the data

Test yourself on Ingesting and processing the data

The full Google Cloud Professional Data Engineer question bank has 733 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.