Prepare and test your skills

Prepare and test your skills

Securing pipeline sources and sinks controls who can act on data, which network paths data can use, and how data stays encrypted. Cloud Dataflow (opens in a new tab) pipelines read from sources such as Cloud Storage buckets, Pub/Sub topics, or on-premises databases and write to sinks such as lakes, warehouses, or messaging topics. Cloud Storage enforces Identity and Access Management (IAM) on buckets and managed folders, while BigQuery enforces IAM on datasets plus row-level security and column-level security with policy tags and dynamic data masking.
VPC Service Controls creates a service perimeter around projects, buckets, datasets, and machine learning resources. Data flows freely among members inside the perimeter, but data flows across the boundary only when an explicit ingress or egress rule permits it. Access follows least privilege from no access upward, with IAM Conditions for attribute rules, principal access boundary policies to cap maximum permissions, and Privileged Access Manager for audited just-in-time elevation. Data at rest is encrypted by default with Google-managed keys, with customer-managed encryption keys (CMEKs) in Cloud Key Management Service (Cloud KMS) when revocation, rotation, or residency control is required.
Private connectivity keeps traffic off the internet. A Virtual Private Cloud (VPC) network with private IP addresses removes internet exposure, Private Service Connect carries traffic from VPC resources to Google APIs over private addresses, and firewall rules deny all traffic by default. For external ingestion, Dedicated Interconnect provides high-throughput private transport, the perimeter allowlists on-premises addresses, and Tink envelope encryption can encrypt sensitive columns locally before upload so plaintext never crosses the external network.
Exam tip: IAM grants who can call an API, VPC Service Controls governs whether data can move across a service perimeter, and BigQuery row-level and column-level security governs which rows and columns a permitted query can see.
Matching entry and exit points aligns arrival pattern and downstream access with the operational profile of the storage or messaging service. The storage layer holds data as files or managed records, while the computation layer loads data from storage, processes it, and saves results back to a target. To reduce latency, transfer cost, and I/O overhead, storage and compute should run in the same zone and region, for example by moving storage from Hadoop Distributed File System (HDFS) to Cloud Storage while running computation on Managed Service for Apache Spark.
| Source or sink | Pipeline role | Operational profile |
|---|---|---|
| Cloud Storage | Batch file source and raw landing sink | High-throughput bulk I/O; colocate bucket and compute in same region |
| Pub/Sub | Streaming source for events and Change Data Capture changes | Low-latency scalable messaging; subscribers process continuously |
| BigQuery | Analytical sink for extract, load, and transform (ELT) | Central warehouse for SQL transforms; fed by transfers or direct writes |
Cloud Storage is the batch source and sink where a pipeline lands raw data into a regional bucket near the processing cluster, then a Spark job reads through the Cloud Storage connector and writes curated results back. Regional buckets replicate synchronously across zones, while dual-region and multi-region buckets replicate asynchronously across regions. Pub/Sub carries data from publishers to a topic and then from the topic to subscribers such as Dataflow, which processes continuously and lands results to bronze storage. BigQuery receives data from Cloud Storage through scheduled transfers, from apps and sources such as Teradata through BigQuery Data Transfer Service, or directly from Hadoop and Spark through the BigQuery connector.
Carrying schema with data preserves field types from extraction through load and lets the sink interpret fields without external definitions. Apache Avro, Apache Parquet, and Apache ORC embed schema with the data, while comma-separated values (CSV) carries no embedded schema and requires explicit schema or auto-detection at load time. Parquet and ORC use columnar layout, which lowers scan cost and speeds analytical queries when Cloud Storage serves as a data lake.
Staging decouples extraction from loading in a fixed order. First, schema and data are extracted to files in the existing environment; then, those files are uploaded to a Cloud Storage bucket; only after upload, data is loaded from the bucket into BigQuery. Data flows from another cloud through Storage Transfer Service, from on-premises with good bandwidth through the gcloud CLI with multi-threaded parallel uploads that resume after errors, and without sufficient bandwidth through Transfer Appliance for offline transfer. Supported load paths from Cloud Storage to BigQuery include BigQuery Data Transfer Service for recurring transfers, the Storage Write API for programmatic writes, and one-time batch loads. When transformation is needed before the sink, data flows from the staging bucket through Dataflow with Beam transforms, through Spark with Spark SQL, or through Cloud Data Fusion, or data flows into a BigQuery staging table where SQL writes transformed output to the final table. For evolution, downstream processes first point at facade views while upstream tables keep the source schema, then new tables are created on the evolved schema and view definitions change to query source tables, new tables, or a SQL UNION of both.
Coordinating multi-step pipelines depends on workload shape, with managed Airflow for heavy data dependencies and serverless sequencing for lightweight service calls. Dataflow Data Pipelines (opens in a new tab) provide recurring execution for Beam jobs, while Cloud Composer authors, schedules, and monitors long-running pipelines as directed acyclic graphs (DAGs) and Workflows runs loosely coupled HTTP-based services in defined order. In Composer, an author defines a DAG, tasks call operators, operators invoke target systems, and downstream tasks run only after dependencies complete.
Unifying batch and streaming transforms with Apache Beam lets one codebase handle bounded batch data and unbounded streaming data on Cloud Dataflow. A developer authors pipelines of PCollections and transforms, and Dataflow distributes stages in parallel across Compute Engine workers in a specified region. Dataflow provides exactly-once processing by default, while streaming pipelines that tolerate duplicates can enable at-least-once mode to reduce cost and latency. Placing transform compute is a choice between extract-transform-load (ETL), where data flows from sources through Beam or Spark transforms before warehouse load, and ELT, where raw data flows into BigQuery first and BigQuery compute performs filtering, joining, and modeling with SQL. Choose Dataflow ETL for event-time logic, per-record enrichment, and unified batch and streaming; choose BigQuery ELT with Dataform and scheduled queries for large set-based SQL modeling and raw replay.
Hot-key skew and external-call overhead need explicit design. When many elements share one key, the worker for that key overloads while others idle, so rekey with a ParDo to spread load or add fanout for partial aggregation before the final combine. For enrichment, native I/O transforms such as BigQueryIO batch elements into fewer requests, but the pipeline must still limit batch size and concurrency because autoscaling can add workers that further overload an external service or exhaust quotas.
VPC networking for pipelines defines where processing runs, how traffic is distributed to healthy backends, and how on-premises sources connect privately. Designing VPC networks in custom mode means creating subnets explicitly per region, with each workload subnet hosting Dataflow workers or Google Kubernetes Engine (GKE) nodes. Private Google Access lets VMs with only internal addresses reach Google APIs, Private Service Connect keeps API traffic on private addresses, and Cloud NAT lets private Pods and VMs initiate outbound connections without receiving inbound internet connections.
Traffic flows from clients to load balancer frontends and then from frontends to backends selected by routing rules and health checks. An Application Load Balancer routes Layer 7 HTTP attributes, a proxy Network Load Balancer terminates TCP or TLS at a proxy for multi-region distribution, and a passthrough Network Load Balancer preserves client source IP without proxy overhead. Firewall enforcement combines distributed stateful rules with hierarchical policies, blocking all traffic by default and allowing only required ports and protocols, with lower-number priorities evaluated first. Routing and hybrid choice decide performance and encryption: Cloud Router creates Border Gateway Protocol routes for HA VPN and Interconnect but carries no data traffic, while Cloud VPN uses IPsec over the internet and Dedicated Interconnect uses direct physical connections for low-latency high-bandwidth ingestion.
Data encryption in Google Cloud protects pipeline data at rest, in transit, and in use through default protection plus customer-controlled keys. Default encryption uses Google-owned keys with automatic rotation, CMEKs move ownership to the customer in Cloud KMS while Google services still perform encryption, and customer-supplied encryption keys (CSEK) supply raw material per request for legacy disks. CMEK uses envelope encryption where the Cloud KMS key acts as a key-encryption key (KEK) that wraps per-chunk data-encryption keys (DEKs) that directly encrypt storage chunks with AES-256.
Governing keys covers where keys live, what hardware protects them, and how rotation and destruction work. A key ring groups keys in a specific project and location, with the recommended pattern of one centralized key project per environment and separate key and data administrators. Rotation creates a new primary version on schedule while older versions remain to decrypt existing DEKs, but rotation does not uniformly re-encrypt old data: Cloud Storage applies the new version only to newly written objects unless old objects are rewritten, and an existing BigQuery table keeps its version until recreated. The key-version lifecycle moves in order from enabled to disabled to scheduled for destruction to destroyed, with restore possible only during the soft-delete window. Traffic inside Google production networks between VMs and from the Google Front End (GFE) onward with Application Layer Transport Security (ALTS) is encrypted by default, while hybrid links leaving Google networks need MACsec for Interconnect or IPsec for VPN.
Continue with this study guide: Planning the data pipelines
Data cleansing inspects, validates, and corrects datasets before analytical use as data flows from collection through storage and transformation into consumption. Visual profiling with Knowledge Catalog creates data profiles that describe formats, ranges, distributions, and completeness to reveal missing values, outliers, and skewed distributions before data is trusted. Knowledge Catalog also manages automatic data quality checks that verify formats and ranges before training, plus lineage, business glossary, and monitoring with Cloud Logging, Cloud Monitoring, and audit logs.
Filtering in Cloud Dataflow sits between managed sources and managed sinks in the ordered flow from ingestion to storage. The pipeline pulls events from Pub/Sub (opens in a new tab), applies parsing, validation, and enrichment with Apache Beam logic, and writes trusted output to BigQuery, Cloud Storage, or Bigtable. Valid records flow to the primary analytical sink while malformed records flow to a dead-letter sink such as a Pub/Sub topic, Cloud Storage prefix, or BigQuery quarantine table for auditing and reprocessing. Post-ingestion standardization in BigQuery loads raw data into a staging table and then uses SQL procedures and functions to clean and write trusted output to a production table, with partitioning, clustering, and row-level and column-level security controlling performance and access.
Selecting a processing service matches the engine to batch, streaming, warehousing, or messaging work. Cloud Dataflow runs Apache Beam pipelines for unified batch and streaming, Spark-based services run cluster and visual integration work, BigQuery stores and transforms warehouse data, and Pub/Sub and Kafka provide ingestion. Dataflow handles provisioning, autoscaling, and fault tolerance so teams focus on pipeline logic.
Cloud Dataflow pipelines read from a source, apply transforms and aggregations, and write to a destination such as BigQuery. The same Beam model handles bounded batch data and unbounded streaming data with windowing, grouping, and joining, separating what to compute from where it runs. BigQuery is the analytical warehouse for terabyte to petabyte datasets, with dataset location set to regional or multi-region, though multi-region does not replicate data across regions. Ingestion arrives through Dataflow pipelines, Cloud Data Fusion Spark jobs, and Datastream change data capture that merges UPSERTs through the BigQuery Write API. Messaging decouples producers from consumers: Pub/Sub provides serverless topics and subscriptions where one publish serves many filtering subscribers, while Apache Kafka provides a broker log that Dataflow reads through the Beam KafkaIO connector where timestamp policy controls watermarks.
Windowing assigns each event in an unbounded PCollection to finite intervals for aggregation so related records can be aligned and joined. Apache Beam supports tumbling windows that place each event in one fixed interval, sliding windows that place each event in multiple overlapping intervals, and session windows that merge events with the same key until an inactivity gap expires. Dataflow applies Window.into after reading from Pub/Sub and before per-key aggregation, then maintains keyed state with combines such as Sum and Count.
| Window type | Assignment | Choose when |
|---|---|---|
| Tumbling windows | One fixed non-overlapping interval per event | Counts or totals per discrete period are needed |
| Sliding windows | Multiple overlapping intervals per event | Moving averages over overlapping time are needed |
| Session windows | Variable burst merged by key until gap expires | Activity with idle breaks must be grouped |
Watermarks estimate event-time completeness from source timestamps, and a window whose end is below the watermark emits its on-time result. Allowed lateness keeps window state alive after the watermark passes so late events can update results before garbage collection. The lifecycle runs in order: first assigned and open, then watermark passes window end, then late arrivals update retained state, then state is discarded. Excessively late events arriving after discard must be dropped and counted or routed to a side output for audit and batch repair. Triggers control when a window emits, with discarding mode emitting only new elements and accumulating mode emitting the full result plus allowed lateness.
Exam tip: The watermark decides what is on time versus late, while allowed lateness decides what is correctable versus excessively late.
Batch processing transforms large historical datasets with restartable jobs and cost-effective ephemeral capacity. Cloud Dataflow is the fully managed serverless service for Beam batch logic where data flows from sources through transforms to destinations, Google allocates Compute Engine workers at job start and deletes them at completion, and the service autoscales and corrects stragglers. Cloud Data Fusion builds batch pipelines visually and executes them as Spark jobs, while BigQuery stores history and runs SQL batch transforms.
Dataflow shuffle partitions and groups data in the service backend instead of on worker virtual machines. The shuffle operation backs GroupByKey, CoGroupByKey, and Combine, which lowers worker CPU, memory, and disk use and improves autoscaling. Batch jobs use Dataflow shuffle by default with a 25 gigabyte boot disk and require the region option without a zone override. Robust batch orchestration defines order and retry behavior so reruns are safe: Cloud Composer runs Airflow DAGs, Workflows sequences HTTP services, and Dataflow data pipelines schedule recurrent jobs. There is no cross-pipeline communication in Dataflow, so one pipeline writes to Cloud Storage and the next reads it back. Pure deterministic DoFn functions with deterministic keys and replay-tolerant sinks make reruns idempotent.
AI enrichment adds predictions, labels, and protected features to batch and streaming pipelines. In-warehouse inference with BigQuery ML trains and scores with SQL instead of moving data, storing models in BigQuery datasets created with CREATE MODEL and writing scored rows back to BigQuery tables. Supported models include linear and logistic regression, k-means, matrix factorization, and time-series models including ARIMA_PLUS. Remote models point to Vertex AI endpoints, with features in Vertex AI Feature Store and orchestration through Vertex AI Pipelines DAGs or Dataform workflows.
Inline enrichment in Dataflow treats a pre-trained API as an external system inside a processing step. Data flows from Cloud Storage or Pub/Sub into Dataflow workers, then to the external API, then enriched results flow onward to BigQuery. Each per-element call adds overhead, so batching multiple elements into fewer requests is preferred. Quotas limit daily totals and requests per second, and Dataflow parallelism multiplies traffic because many workers call the same endpoint concurrently. Securing enriched data removes sensitive information first: Sensitive Data Protection discovers data with infoTypes and applies masking, tokenization, and de-identification, with data flowing to the Cloud Data Loss Prevention API for redaction before only protected data flows to storage or training.
Data acquisition moves batch files and streaming events from on-premises, multi-cloud, and Google Cloud sources into analytical services. Cloud Pub/Sub is the scalable ingestion backbone where data flows from publishers to a topic and then from the topic through subscriptions to Dataflow, so ingestion continues when processing lags. Throughput quotas are independent per project, so pipelines sharing a topic gain maximum throughput when each runs in its own project. Bulk transfer moves large existing datasets without streaming: Transfer Appliance captures 300 terabytes in under 25 days without outbound bandwidth, with data available in Cloud Storage within about 10 business days after shipment.
Integrating a new source maps its volume, velocity, variety, and schema to a batch, streaming, or change-data-capture pattern. Volume sets throughput and storage, velocity decides between batch files and continuous streams, and schema determines tolerance for evolving fields. Batch ingestion moves bounded extracts on schedule to Cloud Storage staging, streaming ingestion moves unbounded Pub/Sub events with windowing, and change data capture replicates inserts, updates, and deletes with UPSERT semantics through Datastream to BigQuery or Cloud Storage. A Pub/Sub subscription stores unacknowledged messages for up to 7 days for buffering and replay. Reliability combines validation, publisher flow control for spikes, synchronous BigQuery storage in two zones, and promotion of tested artifacts such as self-executing Java archives through preproduction before updating streaming jobs. Apache Iceberg (opens in a new tab) tables can serve as managed lake sinks that Dataflow reads and writes for replayable analytics.
Continue with this study guide: Building the pipelines
Job automation and orchestration coordinates data pipelines across Google Cloud services without manual intervention. Google Cloud Workflows handles serverless orchestration of HTTP-based services with low latency, while Managed Service for Apache Airflow (Managed Airflow), formerly Cloud Composer, handles batch extract, transform, and load (ETL) and extract, load, and transform (ELT) pipelines defined as Python directed acyclic graphs (DAGs). Workflows executes a state machine in YAML or JSON that calls microservices in order with millisecond latency and scale down to zero, while Managed Airflow executes Python DAG files with declarative dependencies, tolerates seconds of latency, and supports backfills and re-runs.
| Dimension | Workflows | Managed Airflow |
|---|---|---|
| Best fit | Chaining microservices and external integrations | Batch ETL/ELT, BigQuery or Dataflow triggers |
| Triggers | API, console, client libraries, Cloud Scheduler | Cron-like schedules, Sensors |
| Data passing | Up to 512 KB in variables between steps | Up to 48 KB through XCom between tasks |
| Scaling and billing | Serverless per step executed | Provisioned capacity billed on capacity |
Time-driven scheduling with Cloud Scheduler and Dataform runs transformation code on fixed frequency. A Cloud Scheduler job triggers a Workflows workflow, Workflows pulls Dataform code from Git and compiles it into a compilation result, then creates a workflow invocation and executes it against BigQuery (opens in a new tab). Calling createCompilationResult with gitCommitish clones the remote repository on every run, so production schedules should use release configurations or automated retries with exponential backoff to avoid failures during frequent compilations.
Exam tip: Choose Workflows when millisecond latency and per-step billing matter, and choose Managed Airflow when the pipeline needs backfills, re-runs, and cron-like batch scheduling.
Identity for orchestration centers on a dedicated service account used as the workflow identity. The service account acts when Workflows calls Dataform, so the policy applies to the workflow rather than to an individual user. Grant only required roles: Dataform Editor to create compilation results and invocations, Service Account User on the Dataform identity, and minimum permissions for target resources. Secure orchestration in Managed Airflow uses a user-managed service account that owns the environment and runs DAGs, needing Composer Worker as baseline plus only extra data permissions such as BigQuery, Storage, or Dataflow roles.
Reliable provisioning follows an explicit dependency order where each resource depends on the prior layer:
composer.googleapis.com plus compute, logging, monitoring, storage, Pub/Sub, Cloud SQL, and conditional Secret Manager and Cloud KMS APIs.A Managed Airflow environment provisions a GKE cluster, Airflow web server, environment bucket, Cloud SQL, Pub/Sub, and Artifact Registry. Schedulers and workers run as GKE workloads, while Composer Agent gathers logs to Cloud Logging and metrics to Cloud Monitoring. DAG files are Python files in Cloud Storage, and a batch pattern validates files in the ingestion bucket, creates an ephemeral Spark cluster, runs the Spark job to produce metrics to Parquet or ORC with Dataproc Metastore metadata, then deletes the cluster.
Container artifact versioning with Artifact Registry gives centralized control over the software supply chain. Artifact Registry is a universal package manager where pipeline code, images, and components carry versions, and the same immutable digest moves from development to test to production to support rollback. Remote repositories cache Docker Hub, Maven Central, Python Package Index (PyPI), and operating system packages to improve availability and enable scanning, while virtual repositories consolidate same-format repositories behind one endpoint.
Vulnerability scanning and deployment enforcement establish whether an image is safe to deploy and who built it. Artifact Analysis scans new images in Artifact Registry by extracting package information, then continuously monitors metadata as new vulnerability information arrives and generates a software bill of materials (SBOM). Binary Authorization attaches attestations to images and checks them at deployment to GKE and Cloud Run, verifying builder identity, vulnerability policy compliance, and promotion criteria from development to quality assurance. Least-privilege identities keep scope small with separate accounts per environment: a staging account with write only to its bucket, a Dataflow management account for job lifecycle without data access, and a worker account set with --serviceAccount for compute plus required source and sink access.
Automated testing validates pipeline code inside Cloud Build triggers so bad changes are blocked before deployment. A commit or pull request triggers Cloud Build, which pulls source, runs validation, and only then promotes an immutable artifact to Artifact Registry for deployment by Cloud Deploy. The three test layers block different failures: unit testing validates Beam transforms or DAG parsing, integration testing validates stages and connectors together, and end-to-end testing validates the full path from staging to views as seen by dashboards.
Validating Beam pipelines, Composer DAGs, and SQL logic applies the same gate to three code types. Beam validation flows from source to artifact to execution where Cloud Build runs static analysis and unit tests, then integration tests across Storage, BigQuery, Pub/Sub, and Firestore connectors, then packages the template. Managed Airflow validation uses a presubmit trigger on pull request for unit tests and a sync trigger after merge to copy the DAG to Cloud Storage in development, then promotes the verified DAG to production. Cloud Data Fusion (opens in a new tab) visual pipelines deploy through the same promotion discipline before running as Spark jobs. Infrastructure as Code stores desired infrastructure in Git as Terraform code with state in Cloud Storage, where feature branches run only terraform plan and merges to dev or prod run terraform apply through foundation, infrastructure, and artifact pipelines using stage-specific service accounts.
Continue with this study guide: Deploying and operationalizing the pipelines
Identity and Access Management (IAM) grants who can call an API, Virtual Private Cloud (VPC) Service Controls governs whether data can move across a service perimeter, and BigQuery row-level and column-level security governs which rows and columns a permitted query can see.
Use Google Cloud Workflows for chaining microservices and external integrations where millisecond latency and per-step billing matter, and use Managed Service for Apache Airflow (Managed Airflow) for batch extract, transform, and load (ETL) and extract, load, and transform (ELT) pipelines that need backfills, re-runs, and cron-like scheduling. Workflows passes up to 512 KB in variables between steps, while Managed Airflow passes up to 48 KB through XCom between tasks.
Tumbling windows place each event in one fixed non-overlapping interval for counts or totals per discrete period, sliding windows place each event in multiple overlapping intervals for moving averages over overlapping time, and session windows merge events with the same key until an inactivity gap expires for activity with idle breaks.
Rotation creates a new primary key version while older versions remain to decrypt existing data-encryption keys, but rotation does not uniformly re-encrypt old data. Cloud Storage applies the new version only to newly written objects unless old objects are rewritten, and an existing BigQuery table keeps its original version until recreated.
Last updated