Prepare and test your skills

Prepare and test your skills

Preparing and cleaning data on Google Cloud is the work of turning raw source data into trusted tables and features with the right transformation service and validated quality. Dataform (opens in a new tab) runs SQL transformations inside BigQuery, Dataflow runs Apache Beam code for batch and streaming, and Cloud Data Fusion runs managed integration with reusable plugins. Large language models (LLMs) accelerate this work by drafting SQL, Python, and quality rules, while BigQuery (opens in a new tab) pipelines, validation checks, and human review keep generated code safe to deploy.
Generating transformation code with foundation models is the use of LLMs to draft SQL, Python, documentation, and data quality rules from natural-language intent. Model Garden supplies the foundation models, Agent Studio supplies the environment for developing and refining prompts, and Agent Platform Pipelines orchestrates prompt engineering, response filtering, and evaluation as repeatable steps. Generated outputs flow from the model through automated filtering and quality checks to human review, and only reviewed outputs flow into production pipelines.
Prompt work does not replace validation of generated logic. Python checks for data types, formats, and ranges can run inside Agent Platform Pipelines or BigQuery, and coding assistants improve security only with a human in the loop. GoogleSQL procedural code with constructs such as IF and WHILE can be saved and scheduled, and Dataform supports versioned SQL workflows for extraction, loading, and transformation in BigQuery. When either path calls ML.GENERATE_TEXT, quota-related retryable errors are handled by calling the function iteratively.
Exam tip: Call ML.GENERATE_TEXT iteratively in GoogleSQL or Dataform when retryable quota errors occur, rather than issuing one large call.
Matching Dataform, Dataflow, and Cloud Data Fusion to cleaning work means choosing where compute runs and how logic is expressed. Dataform logic defined in SQL runs directly where warehouse data lives, so large tabular datasets stay in BigQuery during cleaning. The Dataform service account mediates the flow from source tables to destination tables and depends on BigQuery Data Viewer on sources and BigQuery Data Editor on destinations, while access to code assets is controlled separately.
Dataflow and Cloud Data Fusion fit work that SQL in the warehouse cannot easily express:
| Service | Primary interface | Choose when |
|---|---|---|
| Dataform | SQL in BigQuery | Data is already tabular in BigQuery and cleaning is set-based SQL with scheduled freshness |
| Dataflow | Apache Beam code with templates | Volume is large or unbounded and latency needs streaming or combined batch plus stream with custom logic |
| Cloud Data Fusion | Integration pipelines with CDAP plugins | Many heterogeneous sources must be connected through managed, reusable integration blocks |
Dataflow pipelines read from databases, Pub/Sub, Cloud Storage, or APIs, apply Beam transforms for cleaning and enrichment, and write to sinks such as BigQuery. A common pattern clones a template such as Java Database Connectivity to BigQuery and adds Beam transforms before the write. Cloud Data Fusion ingests from source systems, applies plugin transforms, and loads cleaned output to BigQuery without maintaining custom Beam or Spark code.
Validating quality and expanding data with synthetic techniques protects accuracy, relevance, diversity, and alignment of training data. TensorFlow Data Validation validates schemas and detects anomalies in preprocessing, BigQuery anomaly detection finds statistical outliers in stored tables, and Knowledge Catalog automatic checks verify formats, ranges, and distributions on governed assets. Model Armor or fine-tuned models can screen prompts and responses so manipulation does not flow into preprocessing code.
When real data is insufficient or imbalanced, synthetic data expands coverage in a fixed order:
Centralizing cleaned outputs in Feature Store lets multiple models reuse the same features, while Knowledge Catalog standardizes definitions, column-level lineage in BigQuery, and governance across BigLake and open formats such as Iceberg and Delta.
Monitoring and orchestration of data pipelines on Google Cloud coordinates task order and exposes whether pipelines met health and quality targets. Managed Service for Apache Airflow orchestrates data-driven batch workflows such as ETL and ELT, while Workflows chains HTTP-based services into durable workflows. Cloud Dataflow (opens in a new tab) jobs launched by either orchestrator are observed with Cloud Monitoring, Cloud Logging, and the Dataflow monitoring interface, and reliability (opens in a new tab) is restored with idempotence, dead-letter isolation, and disaster recovery.
Choosing between Managed Airflow and Workflows for orchestration is a decision about latency, scheduling complexity, payload size, and recovery needs. Managed Service for Apache Airflow expresses tasks and dependencies in Python as Directed Acyclic Graph files with declarative dependency resolution, where the scheduler launches each task only after upstream tasks succeed. Workflows expresses steps in YAML or JSON with imperative flow control, where the definition explicitly orders each HTTP call and branch.
The two orchestrators differ in speed, scale, and batch features:
| Feature | Workflows | Managed Service for Apache Airflow |
|---|---|---|
| Syntax | YAML or JSON with imperative flow | Python DAG files with declarative dependencies |
| Execution latency | Milliseconds | Seconds between tasks |
| Scaling and billing | Serverless to zero, billed per step | Provisioned capacity, billed on capacity |
| Data processing features | No backfills or DAG re-runs | Supports backfills and re-running DAGs |
Managed Airflow fits recurring ETL and ELT that must wait on Sensors for files or partitions and recover by backfilling missed intervals. Workflows fits event-driven chaining of microservices and operational automation triggered by the API, console, gcloud CLI, or Cloud Scheduler. Data passed through Airflow XCom is limited to 48 KB and variables passed between Workflows steps support up to 512 KB, so bulk data must flow through external storage such as Cloud Storage or BigQuery rather than through the orchestrator.
Exam tip: Choose Managed Airflow when the workload needs backfills and re-running DAGs for historical intervals; Workflows has no backfill features and fits low-latency service chaining instead.
Collecting metrics, logs, and dashboards for pipeline health turns pipeline signals into time series, charts, and alerts. Cloud Monitoring stores metric data, visualizes trends, and fires alerting policies, while Cloud Logging stores detailed event logs in log buckets for troubleshooting. Dataflow operational logs flow to the _Default bucket under dataflow.googleapis.com, and information about completed or cancelled Dataflow jobs is stored for 30 days.
Metric sources flow from producers to Cloud Monitoring storage and then to charts and alerts:
Dataflow worker metrics reach Cloud Monitoring only when the worker service account holds roles/monitoring.metricWriter. Operators view health in Google Cloud-managed dashboards for immediate curated views and in custom dashboards for pipeline-specific trends, outliers, and data-quality views. Metrics Explorer explores time series, compares current to previous data, and saves charts to dashboards, including Dataflow Job charts such as System lag.
Designing idempotent logic, dead-letter handling, and disaster recovery keeps pipelines correct when tasks retry or dependencies fail. In Apache Beam on Dataflow, the parallel unit is a ParDo transform running user code as a DoFn object, and the service may retry, regroup, or duplicate DoFn execution without guarantee of invocation count. DoFn code should therefore follow a pure-function model with no hidden state or unsafe side effects, so retries plus exactly-once processing from the user perspective do not create duplicates.
Dead-letter queues isolate bad records so one failure does not stop good data. The error branch routes the failed message, error details, and original payload to a Pub/Sub dead-letter topic or Cloud Storage path for inspection and replay. Delivery behavior depends on cause: 5xx destination errors retry automatically with exponential backoff for a maximum of 15 minutes, 401 and 403 errors need a replacement job with valid credentials, and other 4xx errors need correction before replay.
Recovery objectives and observability close the loop. Recovery time objective measures time until service resumes and recovery point objective measures acceptable data loss, with cold, warm, and hot patterns trading cost for speed. The four golden signals of latency, traffic, error rate, and saturation guide dashboards and alerts, while an alerting policy defines the threshold and notification list and each firing creates a persistent incident with status, logs, chart, and duration.
Continue with this study guide: Monitoring and orchestration of data pipelines
Disaster recovery and fault tolerance on Google Cloud keep data processing running through zone and region failures with minimal manual work. Disaster recovery (opens in a new tab) across regions restores service from backups and replicas, while high availability within a region survives zone loss with synchronous replication. Automated templates, scheduled backups, self-healing groups, and health-driven traffic shifts replace manual failover steps, and regions and zones (opens in a new tab) define the failure boundaries that each design must survive.
Defining recovery time objective (RTO) and recovery point objective (RPO) for data workloads sets how much downtime and data loss the business can tolerate. RTO is the maximum acceptable time an application can be offline, from disaster until normal service resumes. RPO is the maximum acceptable time during which data might be lost, from the last recoverable copy until the disaster.
Targets tighten with criticality because smaller RTO and RPO need continuous replication and standby capacity:
| Application criticality | Example apps | Zone outage target | Region outage target |
|---|---|---|---|
| Tier 1, most important, 5% of apps | Real-time payments, eCommerce storefronts | RTO Zero, RPO Zero | RTO Zero, RPO Zero |
| Tier 2, 35% of apps | Regional CRM or ERP | RTO 15 mins, RPO 15 mins | RTO 1 hr, RPO 1 hr |
| Tier 3, least important, 60% of apps | Leave booking, travel, HR, accounting | RTO 1 hr, RPO 1 hr | RTO 12 hrs, RPO 12 hrs |
RPO translates directly into backup frequency and replication choice, so backups every 24 hours can lose almost 24 hours of updates. RTO translates into how ready infrastructure, software, and data must be before disaster, from cold images and templates to warm minimal replicas to hot full capacity. Business-critical operations subject to RTO and RPO must depend only on data plane components that continuously process operations, not on management plane operations such as VM-creation APIs or permission updates.
Comparing high availability and cross-region disaster recovery shows why scope determines replication and recovery speed. High availability covers zones within one region with synchronous replication and active-active topology for zero or near-zero RTO and RPO. Disaster recovery covers two or more regions and typically uses asynchronous replication with manual or semi-automated failover, which creates non-zero RTO and RPO unless a managed multi-regional service handles replication.
Resource scope determines what survives without extra work. Zonal resources such as Compute Engine virtual machines and standard Persistent Disk fail with their zone, regional resources such as regional Persistent Disk survive single-zone loss, and multi-regional resources such as Spanner and multi-region Cloud Storage buckets resist zone and region outages. Correlated failure of two or more zones in one region is treated as a regional outage.
Cold, warm, and hot patterns trade running footprint for recovery speed:
| Pattern | Running footprint | RTO and RPO and cost tradeoff |
|---|---|---|
| Cold | Backups, snapshots, images, and templates only | Lowest cost with highest RTO and RPO because everything must be recreated |
| Warm standby | Minimal always-on replica receiving replication | Moderate cost with small RTO and RPO because compute scales up and replica promotes |
| Hot and HA | Full capacity in two environments with continuous replication | Highest cost with minimal RTO and near-zero RPO because traffic shifts on health failure |
Exam tip: HA normally uses synchronous replication between zones in one region with zero or near-zero RTO and RPO, while disaster recovery across regions without multi-regional services typically uses asynchronous replication with non-zero RTO and RPO.
Automating rebuilds, backups, and health detection replaces console steps with versioned templates, scheduled copies, and self-healing topologies. A Compute Engine instance template saves the virtual machine configuration and replicates globally, a custom image holds application binaries, and a startup script creates disks from snapshots, mounts them, and copies backups and transaction logs from Cloud Storage. Deployment Manager templates extend the same approach to networks, firewall rules, and server fleets.
A typical automated cold failover runs in a fixed order:
Traffic flows from clients to Cloud DNS to regional or global load balancers to healthy managed instance groups or Google Kubernetes Engine clusters in surviving zones or regions. Managed instance groups delete and recreate failed virtual machines, regional disks synchronously replicate writes across two zones so a backup virtual machine can force-attach after zonal loss, and Cloud Storage tiering moves older backups to Nearline, Coldline, and Archive. Monitoring ties detection to action through health checks, backup-interval alerts, Storage Transfer Service notifications, and restore tests in non-production environments.
Continue with this study guide: Disaster recovery and fault tolerance
Making decisions related to ACID compliance and availability means balancing strict transactional guarantees against performance, cost, and survival during partitions. Availability keeps globally distributed systems accepting reads and writes when zones, regions, or links fail. Partition tolerance keeps serving traffic during a network split while managing consistency and latency tradeoffs through replication choice and topology.
Evaluating Spanner, Cloud SQL, Firestore, and Bigtable for transactions compares replication scope, copy behavior, and failover mechanics. Cloud Spanner is a distributed database with built-in redundancy and synchronization across zones and regions. In a regional configuration Spanner maintains three read-write replicas in three different zones, each holding a full copy able to serve reads and writes, while multi-region configurations use two read-write regions plus a witness region for consistent active-active operation.
Cloud SQL uses a primary and standby model for high availability within a region, where the instance spans a primary and secondary zone and fails over automatically to standby without changing the endpoint. Cross-region read replicas protect against regional loss and can be promoted to the new primary with RPO close to zero, including cascading replicas that protect the promoted primary. Firestore offers regional multi-zone replication that survives zone loss and multi-region multi-zone replication that withstands loss of entire regions without data loss. Bigtable runs production instances with a minimum of two clusters in unique zones in one region, with automatically managed synchronization creating an independent copy per zone so traffic can fail over to another cluster in the same instance.
| Service | Replication scope | Failover and durability behavior |
|---|---|---|
| Cloud Spanner | Regional with three zonal replicas, or multi-region with two read-write plus witness | Full copy per read-write replica; supports consistent active-active operation |
| Cloud SQL | Regional primary plus standby; optional cross-region replicas | Automatic zonal failover; cross-region replica promotes to primary with RPO close to zero |
| Firestore | Regional multi-zone or multi-region multi-zone | Regional survives zone loss; multi-region withstands region loss without data loss |
| Bigtable | Minimum two clusters in unique zones in one region | Managed sync per zone; traffic fails over within the same instance |
Exam tip: Choose Firestore multi-region when the workload must maintain availability without data loss during loss of an entire region; choose Firestore regional when data must remain in a multi-zone configuration inside one region.
Trading consistency, latency, and loss in replication choices determines whether every commit is durable before acknowledgment. Synchronous replication writes to multiple zones or regions before acknowledging, which preserves consistency and RPO but increases latency and cost. Asynchronous replication acknowledges locally and transfers changes later, which keeps writes fast and available during a partition but accepts eventual consistency and potential loss.
Managed multi-regional services reduce custom failover work with different guarantees. Spanner provides synchronized redundancy across regions for relational data needing strong consistency, Cloud Storage dual-region and multi-region buckets write metadata synchronously and replicate object data asynchronously, and Cloud SQL high availability provides near active-active behavior with cross-zone replicas. Cloud Storage dual-region turbo replication carries an RPO of 15 minutes for replicated objects, while regional buckets replicate synchronously across zones and need separate replication to survive region loss. Reliability building blocks (opens in a new tab) favor wider scope first, using regional over zonal and multi-regional or global over regional, with regular failover tests.
Durable ingestion and regional execution complete the picture for event-driven streams. Pub/Sub encrypts messages at rest and in transit by default and pins message storage to required locations, then data flows from producers to topics to subscriptions to sinks such as Cloud Storage. Cloud Run stores data synchronously across zones in a region and balances traffic across them, so zone loss does not stop jobs but region loss does. Infrastructure reliability (opens in a new tab) requires that business-critical operations depend only on data plane components that continuously process operations, with redelivery plus checkpointed sinks producing the same final state after retry.
Calculating aggregate availability and removing single points of failure shows how stack design changes end-to-end uptime. For tiers that must all succeed in sequence, called chained services, aggregate availability is the product of each tier: tier1_availability x tier2_availability x tierN_availability. Four tiers at 99.9% each yield only 99.6%, and aggregate availability is always lower than the least-available tier.
Where feasible, parallelization raises availability because each service runs independently:
1 - (1 - A) x (1 - B).Elimination of single points of failure applies this math by duplicating every critical tier. Controls include deploying multiple application servers and databases across zones, using regional managed instance groups and regional GKE clusters to recreate failed virtual machines, distributing requests with Cloud Load Balancing and health checks, using high availability database configurations, and using regional persistent disks or Hyperdisk Balanced High Availability for synchronous cross-zone storage. For critical pipelines, the recommended topology spans at least two regions with three zones each and overprovisions by one-third so surviving zones absorb failover surge.
Data validation on Google Cloud is the set of checks, contracts, and telemetry that keeps data complete, consistent, and correct from ingestion to training and serving. Cloud Dataflow enforces per-record checks in flight, while Knowledge Catalog and BigQuery enforce dataset-level checks before use. Governed data management (opens in a new tab) ties these checks to lineage, business vocabulary, and audit trails so errors are caught early and trusted data is reusable, with security controls (opens in a new tab) guarding against poisoning and exposure.
Applying real-time and batch quality rules validates three dimensions of fitness for purpose: completeness that required records and values are present, consistency that types and formats match schema, and correctness that values and distributions reflect reality. Cloud Dataflow validates streaming and batch data inside ingestion and preprocessing code, where Python logic checks types, formats, and ranges as each record passes from sources through transforms to sinks. Knowledge Catalog centrally manages quality checks, profiles, lineage including column-level lineage in BigQuery, discovery across data marts, feature metadata, and governance across BigLake and open formats such as Iceberg and Delta.
The two approaches validate best at different points:
| Approach | What it validates best | Operational implication |
|---|---|---|
| Cloud Dataflow streaming validation | Per-record types, formats, and ranges during ingestion | Faster containment, but streaming updates may need parallel jobs |
| Knowledge Catalog and BigQuery batch validation | Completeness, profiles, distributions, and anomalies suggesting poisoning | Broader context before training, with direct launch of new batch jobs |
BigQuery complements governed checks with anomaly detection using statistical or machine learning models, and Feature Store schedules monitoring of features and feature groups after ingestion. Streaming sees one record or window at a time and excels at containment, while batch sees whole tables and excels at drift and poisoning detection. Robust validation before training therefore verifies formats, ranges, and distributions together rather than only one dimension.
Exam tip: Use Dataflow Python checks for per-record type, format, and range validation in flight, and use Knowledge Catalog automatic data quality plus BigQuery anomaly detection for distribution and anomaly validation across the full dataset.
Enforcing contracts and closing the loop from alert to remediation turns definitions into enforced use and reliable response. A data contract is a structured agreement between providers and consumers that defines schema, types, business rules, and allowed use. BigQuery schemas define the structural half through datasets, tables, columns, types, and fixed regional or multi-region location, while Pub/Sub topics and subscriptions enforce the event half as messages flow from publishers to subscribers with buffering when pipelines stop.
Data Catalog tags make the contract discoverable and machine-enforceable by attaching provider agreements, encryption and de-identification techniques, sensitivity and assessment links, retention and expiration actions, quality success percentages, cost metrics, and provenance to each asset. Enforcement follows an ordered lifecycle where each stage depends on the prior stage: define agreements and thresholds in BigQuery tables, label assets with tags, link consumer agreements to Identity and Access Management bindings with row-level and column-level controls, enforce purpose with query labels and retention actions, and report findings through Pub/Sub with a BigQuery audit trail. A consumer with table access can still be denied when querying sensitive data without a valid query-label purpose matching entitlement.
Telemetry converts detections into action in sequence:
Cloud Logging captures what happened as events, Cloud Monitoring measures how metrics change and fires alerts, and Cloud Audit Logs record who performed the API action. Validation results stored in BigQuery link alerts to failing batches, lineage traces artifacts from source through transforms to served tables, and file integrity checks on size and checksum detect corruption before downstream checks run.
Continue with this study guide: Data validation
Use Dataform when data is already tabular in BigQuery and cleaning is set-based SQL with scheduled freshness, use Dataflow with Apache Beam code when volume is large or unbounded and needs streaming or combined batch plus stream with custom logic, and use Cloud Data Fusion when many heterogeneous sources must be connected through managed reusable integration blocks. Dataform logic runs directly where warehouse data lives so large tabular datasets stay in BigQuery, while Dataflow pipelines read from databases, Pub/Sub, Cloud Storage or APIs and write to sinks such as BigQuery, and Cloud Data Fusion loads cleaned output to BigQuery without maintaining custom Beam or Spark code.
Managed Service for Apache Airflow expresses tasks and dependencies in Python as Directed Acyclic Graph files with declarative dependency resolution and supports backfills and re-running DAGs, while Workflows expresses steps in YAML or JSON with imperative flow control and has millisecond execution latency with no backfill features. Managed Airflow fits recurring ETL and ELT work that must wait on Sensors for files or partitions and recover by backfilling missed intervals, while Workflows fits event-driven chaining of services, and bulk data must flow through external storage because Airflow XCom is limited to 48 KB and Workflows variables support up to 512 KB.
High availability covers zones within one region with synchronous replication and active-active topology for zero or near-zero recovery time objective (RTO) and recovery point objective (RPO), while disaster recovery across two or more regions typically uses asynchronous replication with manual or semi-automated failover which creates non-zero RTO and RPO unless a managed multi-regional service handles replication. Cold, warm standby, and hot patterns trade running footprint for recovery speed, with cold using only backups, snapshots, images and templates at lowest cost and highest RTO and RPO and hot using full capacity in two environments with continuous replication at highest cost and minimal RTO and near-zero RPO.
For chained tiers that must all succeed in sequence, aggregate availability is the product of each tier so four tiers at 99.9 percent each yield only 99.6 percent and aggregate availability is always lower than the least-available tier. For parallel services availability is higher because each service runs independently so two parallel services at 99 percent each yield 99.99 percent, and 99.9 percent allows about 86 seconds of downtime per day while 99 percent allows about 864 seconds per day.
Last updated