Pipeline planning on Google Cloud is the act of converting a business requirement into a written contract between producers, transformers, and consumers, and then translating that contract into infrastructure decisions before any code is committed.
Planning that skips this step produces pipelines that look correct in development, then collide with quota, network, or compliance constraints when they reach production scale. The exam reflects this reality. A large share of Section 2 items hinge on whether the candidate has thought through sources, sinks, semantics, and security boundaries up front, not whether they can name a particular CLI flag.
How it works
Three planning failures dominate post-mortems on Google Cloud pipelines.
- The first is sink misalignment, where the chosen sink cannot accept the throughput, schema evolution pattern, or latency profile that the source actually produces.
- The second is network blindness, where a pipeline is built without checking whether the source endpoint is reachable from the worker subnetwork or whether Private Google Access is enabled.
- The third is encryption-by-default complacency, where teams assume Google-managed encryption is sufficient and only discover at audit time that key residency, rotation, or revocation requirements demand customer-managed keys.
The remainder of this section addresses each of those failure modes in turn.
Defining data sources and sinks
A source is any system that emits data into a pipeline; a sink is any system that receives the pipeline output. Both must be specified along five axes before any service selection happens: schema, throughput, latency expectation, ordering guarantees, and access control.
A source described only as "the orders database" without those five axes is not yet planned. Cloud Storage, BigQuery, Pub/Sub, Bigtable, Cloud SQL, Spanner, AlloyDB, Firestore, third-party APIs, on-premises message brokers, and SaaS connectors are all candidate sources or sinks. Each has its own throughput envelope and access model.
For batch sources, the planning question is whether the source is bounded (a fixed set of files at a specific path) or whether the source emits files continuously into a watched location. Cloud Storage is the canonical batch source for both shapes.
A pipeline that reads gs://bucket/orders/dt=2024-09-01/*.parquet operates on a bounded set; a pipeline that watches a prefix and reads new objects as they land operates on an unbounded source even though the underlying data format is batch oriented. Confusing those two modes is one of the most common architectural errors, because the second mode requires Pub/Sub notifications on the bucket or a polling mechanism with strong duplicate handling.
For streaming sources, the planning question is whether the source provides event time in the payload, whether messages can arrive out of order, and what the publisher guarantees in terms of at-least-once or exactly-once delivery. Pub/Sub provides at-least-once delivery by default and exactly-once delivery as an opt-in subscription feature at reduced throughput.
Apache Kafka offers idempotent producers and transactional writes that approximate exactly-once when both producer and consumer cooperate. A source that emits only ingestion time, with no payload timestamp, forces the pipeline to use processing-time windows, which closes the door on accurate late-data correction.
For sinks, the planning question is shape, throughput, and update semantics.
- BigQuery accepts streaming inserts through the legacy
insertAllAPI or through the BigQuery Storage Write API. - The Storage Write API supports exactly-once semantics through stream offsets, supports CDC operations through default streams in pending mode, and provides higher throughput at lower cost than
insertAll.
When to use
- Bigtable is the right sink for high-throughput key-based writes where the access pattern is single-row lookup or range scan.
- Cloud Storage is the right sink when downstream consumers expect partitioned files (Parquet or Avro) that other tools can read independently.
- Spanner is the right sink when transactional consistency across rows is required during the write path.
Source-Sink Contract Template
=============================
Source name: orders_topic (Pub/Sub)
Schema source: schema registry (Avro, version pinned)
Throughput peak: 45,000 messages per second
Throughput average: 8,000 messages per second
Latency budget: end-to-end < 30 seconds (p99)
Ordering: per order_id (publish ordering key)
Delivery: at-least-once
Idempotency key: event_id (UUID v4)
Sink name: orders_curated (BigQuery)
Sink write mode: Storage Write API, exactly-once stream
Sink partitioning: ingestion_time, daily
Sink clustering: order_id, customer_id
Schema evolution: additive only, breaking changes via versioned table
The contract above is what the pipeline must verify on startup.
If schemas can drift, the pipeline needs a schema-registry lookup step.
If ordering matters, the source must use ordering keys and the sink must apply per-key reduction in a stateful step.
If exactly-once is non-negotiable, the sink must be one that supports it natively, because attempting to bolt exactly-once onto an at-least-once sink with application-level deduplication is error prone at scale.
💡 Exam Trap: Pub/Sub ordering keys preserve order only within a key. A subscription that uses ordering keys still receives messages from different keys in arbitrary order. Candidates who interpret "ordered delivery" as a global guarantee select wrong answers on topology questions.
💡 Exam Trap: Pub/Sub exactly-once delivery applies between Pub/Sub and the subscriber. It does not extend to the sink the subscriber writes to. A pipeline that pulls exactly-once from Pub/Sub but writes to BigQuery with
insertAllcan still produce duplicates downstream, because the subscriber may acknowledge before the BigQuery row insert succeeds on a retry.
📊 Limit: Pub/Sub exactly-once delivery subscriptions have a maximum acknowledgment deadline of 600 seconds and require the subscriber to call
modifyAckDeadlineif processing exceeds the initial deadline. Misconfiguring the deadline reintroduces duplicates.
Defining data transformation and orchestration logic
Transformation logic divides into stateless and stateful operations. Stateless operations (filter, project, map, parse) require no memory across records and scale horizontally without coordination.
Stateful operations (aggregate, join, deduplicate, sessionize) require keyed state and a windowing strategy. Planning a pipeline means writing down which transforms are stateless and which are stateful, and for the stateful ones, the key, the window, and the trigger.
Skipping this step produces pipelines that scale until the state size on each worker exhausts memory.
Orchestration logic is the layer above transformation. Cloud Composer is the right choice when the orchestration graph contains heterogeneous systems (BigQuery jobs, Dataflow launches, REST API calls, sensors that wait on Cloud Storage objects, Dataproc cluster submissions), when the schedule must respect calendars and SLAs, and when the workflow contains conditional branches with custom Python logic.
Workflows is the right choice when the orchestration is a linear or branching sequence of API calls with retries and conditional logic but no need for an external scheduler, sensor library, or Python operator surface. Dataform handles SQL-only DAGs inside BigQuery without an external orchestrator.
# Composer DAG sketch for a daily curated pipeline
from airflow import DAG
from airflow.providers.google.cloud.operators.dataflow import DataflowStartFlexTemplateOperator
from airflow.providers.google.cloud.operators.bigquery import BigQueryInsertJobOperator
from airflow.providers.google.cloud.sensors.gcs import GCSObjectsWithPrefixExistenceSensor
from datetime import datetime, timedelta
default_args = {
"owner": "data-platform",
"retries": 3,
"retry_delay": timedelta(minutes=5),
"depends_on_past": False,
}
with DAG(
dag_id="orders_curated_daily",
schedule_interval="0 2 * * *",
start_date=datetime(2030, 1, 1),
default_args=default_args,
catchup=False,
max_active_runs=1,
tags=["orders", "curated"],
) as dag:
wait_for_files = GCSObjectsWithPrefixExistenceSensor(
task_id="wait_for_raw_files",
bucket="acme-raw-orders",
prefix="dt={{ ds }}/",
timeout=60 * 60 * 4,
mode="reschedule",
)
launch_dataflow = DataflowStartFlexTemplateOperator(
task_id="launch_dataflow_curate",
project_id="acme-data-prod",
location="us-central1",
body={
"launchParameter": {
"jobName": "curate-orders-{{ ds_nodash }}",
"containerSpecGcsPath": "gs://acme-templates/curate-orders.json",
"parameters": {
"inputPrefix": "gs://acme-raw-orders/dt={{ ds }}/",
"outputTable": "acme-data-prod:curated.orders${{ ds_nodash }}",
"kmsKey": "projects/acme-keys/locations/us/keyRings/orders/cryptoKeys/curate",
},
}
},
)
validate_load = BigQueryInsertJobOperator(
task_id="validate_loaded_rows",
configuration={
"query": {
"query": (
"SELECT IF(COUNT(*) = 0, ERROR('empty partition'), 1) "
"FROM `acme-data-prod.curated.orders` "
"WHERE _PARTITIONDATE = '{{ ds }}'"
),
"useLegacySql": False,
}
},
location="US",
)
wait_for_files >> launch_dataflow >> validate_load
Notice that the DAG above does not embed transformation logic; it orchestrates a Dataflow Flex Template that contains the transformation logic, and then validates the result with a BigQuery assertion. That separation is a planning decision.
Embedding transformation logic inside Airflow operators is an anti-pattern because:
- Airflow workers are not autoscaled compute
- do not provide checkpointing
- do not handle large data volumes efficiently
⚠️ Anti-Pattern: Running pandas transformations inside an Airflow PythonOperator on Cloud Composer. The worker pod has fixed memory and no horizontal scaling, so the job either runs out of memory on large inputs or blocks scheduler capacity. Push the transformation to Dataflow, Dataproc, or BigQuery and keep the operator as a launcher.
🎯 Scenario: A team needs to ingest a hierarchical XML feed from a partner SFTP server, parse it into rows, and load it into BigQuery once per hour. The XML files are at most 200 MB each. The planning decision is to use a Cloud Storage transfer step to land the file, a Dataflow job that uses the Beam XML connector to parse, and a Composer DAG that schedules the run with a sensor that waits for the SFTP drop. The data engineer rejects an alternative that uses Cloud Functions because the function memory ceiling and execution time would constrain parsing on the upper tail of file sizes.
Decision Anchor. Choose Cloud Composer when the workflow spans more than three heterogeneous Google Cloud services, includes sensors or backfills, and the operations team already runs Airflow. Choose Workflows when the orchestration is a sequence of HTTPS calls or service invocations with conditional branches and the total step count is moderate.
Choose Dataform when the entire workflow is SQL inside BigQuery and the team prefers declarative dependency resolution over imperative DAGs.
Networking fundamentals
Networking determines whether a pipeline can reach its sources and sinks at all.
Dataflow workers run in a VPC subnetwork specified at job launch through --subnetwork or --network. Workers without external IPs require Private Google Access enabled on the subnetwork so they can reach Google APIs such as Pub/Sub, BigQuery, Cloud Storage, and Cloud KMS through the API plane without traversing the public internet.
Dataproc clusters work the same way: each node runs in a subnetwork, and Private Google Access controls whether the node can reach managed APIs without a public address.
When the source is on-premises or in another cloud, the pipeline needs a network path.
- Cloud Interconnect and HA VPN provide that path for sustained traffic.
- Datastream supports private connectivity through a private VPC peering configuration when the source database is in a private network.
- Cloud Data Fusion runs in a tenant project and reaches user-project resources through a VPC peering relationship, so private IP access from Cloud Data Fusion requires that the peered network be configured to advertise the necessary routes.
VPC Service Controls add a perimeter around managed services.
A pipeline that reads from a BigQuery dataset inside a perimeter must run from a service account that is allowed by the perimeter ingress rules, and any data export to a sink outside the perimeter is blocked by default unless an egress rule permits it.
The most common planning oversight is forgetting that Cloud Storage object reads from outside the perimeter, even from another Google Cloud project owned by the same organization, count as protected service access and are blocked without explicit ingress configuration.
Subnetwork planning checklist
=============================
[ ] Workers run with internal IP only? (--no-use-public-ips)
[ ] Private Google Access enabled on subnetwork?
[ ] Subnetwork has enough secondary IP capacity for max worker count?
[ ] Firewall allows internal Dataflow worker-to-worker traffic
on TCP 12345 to 12346?
[ ] Egress firewall allows TCP 443 to googleapis.com?
[ ] If sink is on-premises: Cloud Interconnect / HA VPN configured?
[ ] If source is private DB: Datastream private connectivity attached?
[ ] If VPC SC perimeter applies: service account in access policy,
ingress and egress rules cover required services?
Worker IP planning is non-trivial.
Dataflow workers reserve one primary IP per VM and additional secondary IPs depending on configuration.
A subnetwork that has only 254 usable addresses cannot host an autoscaling job that grows to 200 workers, because other tenants in the same subnetwork compete for addresses.
Planning a /22 or larger primary range for pipeline-heavy subnetworks is standard practice.
📊 Limit: Dataflow worker VMs require firewall rules that allow TCP traffic between workers on ports 12345 and 12346 for shuffle and worker harness coordination. The default VPC firewall rules satisfy this; custom networks often do not. Job startup hangs are the symptom.
💡 Exam Trap: Private Google Access is a subnetwork attribute. It is not the same as Private Service Connect, which exposes managed services through dedicated endpoints. Questions that conflate the two test whether the candidate knows the difference. Private Google Access keeps traffic on Google network without an external IP; Private Service Connect creates an endpoint inside the VPC for selected APIs or partner services.
Data encryption
All data on Google Cloud is encrypted at rest by default with Google-managed encryption keys.
Planning for encryption beyond the default focuses on three questions:
- where the key material lives,
- who can revoke access,
- whether key rotation is automatic.
- Customer-managed encryption keys through Cloud KMS provide ownership of the key resource within the customer project.
- Customer-supplied encryption keys provide raw key material with each request, used in narrow cases such as legacy compliance requirements and only on a small subset of services.
- Cloud External Key Manager places the key material outside Google Cloud at a partner key service, which a regulated workload may require.
For pipelines, the encryption planning surface includes the source, intermediate storage, and sink.
A Dataflow job that reads from a CMEK-protected Cloud Storage bucket, processes through Pub/Sub topics with CMEK, and writes to a CMEK-protected BigQuery dataset needs the Dataflow service account to have roles/cloudkms.cryptoKeyEncrypterDecrypter on each key. The job itself can also be launched with --dataflowKmsKey, which encrypts state and temp data on Dataflow-managed disks with the specified key.
# Launch a Dataflow job with CMEK protecting state, temp data, and sinks
gcloud dataflow flex-template run "curate-orders-$(date -u +%Y%m%d-%H%M%S)" \
--template-file-gcs-location="gs://acme-templates/curate-orders.json" \
--region="us-central1" \
--subnetwork="https://www.googleapis.com/compute/v1/projects/acme-net/regions/us-central1/subnetworks/data-private" \
--disable-public-ips \
--service-account-email="curate-orders@acme-data-prod.iam.gserviceaccount.com" \
--dataflow-kms-key="projects/acme-keys/locations/us-central1/keyRings/orders/cryptoKeys/dataflow" \
--parameters=inputPrefix="gs://acme-raw-orders/dt=2030-01-01/",outputTable="acme-data-prod:curated.orders\$20300101"
Three encryption topics carry the most exam weight. First, CMEK rotation: KMS supports automatic key rotation at a configurable period, which creates new key versions.
Existing data stays encrypted by older versions; new writes use the latest primary version. Disabling a key version makes the data unreadable until it is re-enabled.
Second, regional alignment: a key in us-central1 cannot protect a multi-region US BigQuery dataset directly. Multi-region datasets require keys in the matching multi-region (us or eu).
Third, CMEK on Pub/Sub topics encrypts message data at rest in Pub/Sub storage; it does not change transport encryption, which is always TLS.
💡 Exam Trap: Customer-supplied encryption keys (CSEK) are not interchangeable with CMEK. CSEK requires the caller to supply the key material with each request, is supported on Cloud Storage and Compute Engine disks, and is incompatible with most managed analytic services. Questions that ask about a CMEK key being supplied per request are usually asking about CSEK by mistake; the candidate should select the answer that names the correct technology.
⚠️ Anti-Pattern: Storing application secrets in Cloud Storage objects without CMEK, then later attempting to revoke access by deleting the file. Object deletion does not delete previously rendered cached representations downstream. Use Secret Manager for secrets, and use CMEK on data buckets to make revocation through key disabling effective.
📊 Limit: Cloud KMS supports automatic rotation periods between 1 day and 100 years for symmetric encryption keys, with a default rotation period of 90 days when automatic rotation is enabled. Rotation creates a new primary version; old versions remain available for decryption until manually disabled or destroyed.
Decision Anchor. Choose default Google-managed keys (GMEK) when there is no regulatory requirement to control the key lifecycle. Choose CMEK with Cloud KMS when the organization must hold the key reference, rotate on its own schedule, or revoke access through key disabling. Choose Cloud External Key Manager when the regulator requires the key material to live outside Google infrastructure.
Planning summary diagram
The diagram below shows how planning decisions feed into pipeline construction. Each planning artifact must exist before the corresponding implementation step starts.
A pipeline plan that omits any node in the chain above is incomplete. The exam reflects this by writing scenarios that drop one input (for example, omitting the network path) and asking the candidate to identify what is missing. ---
