Maintaining and automating data workloads

PDE notes, 18% of the exam, updated November 2026

This domain is about 18% of the exam. It asks how you keep pipelines and warehouses cheap, predictable, observable and recoverable. Expect scenarios on slot reservations, Composer DAGs, Dataflow stuck jobs, quota errors, a surprise bill, or a region outage.

Optimising resources and cost

Principles

  • Meet the business need at the lowest cost: match capacity to the deadline and criticality of each workload. Not everything needs real time, premium machines or dedicated capacity.
  • Right-size and schedule: shut down idle resources, use ephemeral compute, autoscale, and run non-urgent batch work in cheap or idle capacity.
  • Use budgets and alerts (Cloud Billing), billing export to BigQuery with labels, labels on jobs, datasets and clusters for chargeback, and Recommender for idle or oversized resources.
  • Committed use discounts (CUDs) for steady Compute Engine and Dataproc VM usage; slot commitments for BigQuery; Spot VMs for fault-tolerant workers.

Cost levers by service

Service Levers
BigQuery Partition and cluster; select needed columns; use require_partition_filter; materialised views for repeated work; batch loads (free) instead of streaming; set maximum bytes billed and custom quotas; capacity pricing (editions) when scanning is heavy; physical storage billing; table expiration; remove unused snapshots; INFORMATION_SCHEMA to find costly queries
Dataflow Autoscaling bounds, FlexRS for delayable batch, Streaming Engine/Shuffle, right machine type, avoid hot keys, at-least-once streaming mode, regional co-location
Dataproc Ephemeral clusters, autoscaling policies, Spot secondary workers, scheduled deletion (--max-idle, --max-age), Serverless for Apache Spark, Cloud Storage not HDFS, smaller cluster for shuffle-light jobs, custom images to cut start-up time
Pub/Sub Batch messages, shorter retention, filter at subscription, avoid republishing
Cloud Storage Classes, Autoclass, lifecycle rules, deleting incomplete multipart uploads, compaction of small files, region choice
Bigtable Autoscaling, SSD only when needed, delete unused clusters, GC policies
Composer Right environment size, autoscaling workers, deferrable operators, delete dev environments, Composer 3 pricing is based on usage

Persistent vs job-based Dataproc clusters

Persistent Job-based (ephemeral)
Lifecycle Always on Created for a job (workflow template, Composer), deleted after
Cost Pays when idle Pays only for run time
Storage HDFS possible, but data is lost if cluster is deleted Cloud Storage (connector); state outlives clusters
Isolation Shared, noisy neighbours One cluster per job or team, tuned per job
Best for Constant load, ad hoc notebooks, low-latency start required Scheduled and batch jobs (default recommendation)
  • Cut start time with custom images and initialization actions baked in. A cluster pool or persistent small cluster plus autoscaling can serve many short jobs. Serverless for Apache Spark removes the choice altogether.

Ensuring capacity for critical work

  • BigQuery: dedicate a reservation (baseline slots) to business-critical workloads so they aren’t starved by ad hoc queries; give lower-priority workloads an autoscaling or idle-slot reservation; use assignments at project, folder or organisation level.
  • Dataflow and Dataproc: set max workers high enough, check quotas (CPUs, IP addresses, persistent disks) in the region ahead of time, and request increases; reservations of Compute Engine capacity guarantee VMs; avoid Spot for jobs that must finish.
  • Pub/Sub, Bigtable, Spanner: provision nodes or autoscale with headroom; avoid single-key hotspots.

Automation and repeatability

Cloud Composer DAGs

  • A DAG is Python that defines tasks (operators), dependencies (>>), schedule (schedule/cron), start_date, catchup, default_args (retries, retry_delay, email_on_failure), and optionally max_active_runs, SLA or timeouts.
  • Operators for Google services: BigQueryInsertJobOperator, DataflowTemplatedJobStartOperator/BeamRunPythonPipelineOperator, DataprocCreateClusterOperator, DataprocSubmitJobOperator, DataprocDeleteClusterOperator (with trigger_rule='all_done' so the cluster is deleted even if the job fails), GCSToBigQueryOperator, CloudDataFusionStartPipelineOperator, DataformCreateWorkflowInvocationOperator, sensors (GCSObjectExistenceSensor, BigQueryTableExistenceSensor) and deferrable versions.
  • Design for repeatability: idempotent tasks (overwrite a partition or use MERGE, not blind append), use logical date ({{ ds }}) rather than now(), keep task logic in the target service (Composer orchestrates, it doesn’t process data on the workers), small tasks, retries with exponential backoff, catchup/backfill for history, Variables, Connections, Secret Manager backend for configuration, task groups, XCom only for small metadata, dynamic task mapping, ExternalTaskSensor or datasets for cross-DAG dependencies.
  • Composer environment: managed on GKE; DAGs, plugins and data in a Cloud Storage bucket; scale workers with autoscaling; private IP; snapshots for DR and upgrades; Airflow metadata database managed; use Cloud Logging for task logs and Cloud Monitoring metrics (dag_processing, scheduler heartbeat, task failures).
  • Alternatives for simple cases: Workflows (HTTP steps with retries), Cloud Scheduler (cron triggers), BigQuery scheduled queries and Dataform workflow configs (SQL only), Dataflow templates scheduled by Scheduler, Eventarc triggers for event-driven runs.
  • Repeatable deployment: Terraform for the infrastructure, CI/CD for DAG and pipeline code, parameterised environments, no manual console changes.

Organising workloads: capacity and BigQuery editions

Editions and slots

Standard Enterprise Enterprise Plus
Autoscaling slots Yes Yes Yes
Commitments (1/3 year) No (pay as you go) Yes Yes
Baseline slots No Yes Yes
Typical features Basic analysis, limited governance Security and governance features such as row/column policies, CMEK, BigQuery ML, and more Highest: managed disaster recovery, extra compliance and higher limits
  • On-demand (per TiB scanned; project has a shared pool, default about 2,000 slots) vs capacity (editions: per slot-hour, billed for slots allocated or autoscaled). Choose on-demand for spiky, low volume or exploratory use; capacity for predictable, heavy or business-critical workloads where cost predictability and guaranteed capacity matter.
  • A reservation is a named pool of slots in a location and edition. Settings: baseline slots (always available, billed continuously), autoscale max (extra slots billed only while used, scaling in increments of 50), idle slot sharing across reservations in the same admin project. Commitments (monthly via pay as you go, annual, three-year) discount baseline slots.
  • Assignments attach a reservation to a project, folder or organisation, per job type: QUERY, PIPELINE (load, export, copy), ML_EXTERNAL, BACKGROUND (such as search index and clustering maintenance), or CONTINUOUS. Load jobs run in the shared free pool unless you assign PIPELINE jobs to a reservation. A NONE assignment excludes a project from capacity and sends it back to on-demand-style billing (and NONE also stops usage).
  • Admin project: centralise reservations in a project that holds only slot commitments (no data); give different reservations for prod, dev, ETL and BI; use the slot estimator and INFORMATION_SCHEMA.JOBS_TIMELINE/RESERVATIONS to size.
  • Workload isolation: put interactive dashboards in one reservation, ETL in another, ad hoc in an autoscaling one; so a runaway query cannot starve critical work.

Interactive vs batch

  • Interactive jobs (default) start immediately and count toward concurrency; batch priority queues the query until idle slots exist (the job starts within up to 24 hours otherwise it fails), doesn’t count toward concurrent-query quotas and runs in on-demand pools or idle slots. Use batch for non-urgent ETL and overnight reports.
  • Job concurrency/query queue: dynamic queue lengths manage concurrent interactive queries; set max concurrency for reservations.
  • Other job types: load, extract (export), copy, continuous queries (streaming SQL). Load, copy and export jobs are free on the shared pool.

Monitoring and troubleshooting

Observability

  • Cloud Monitoring metrics and dashboards; alerting policies with notification channels; Cloud Logging (including log-based metrics, sinks to BigQuery or Pub/Sub); Error Reporting; Cloud Trace for APIs; Audit logs (Admin Activity always on, Data Access configurable).
  • BigQuery: administrative resource charts and BigQuery Admin panel (slot usage, job concurrency, shuffle, jobs), INFORMATION_SCHEMA.JOBS, JOBS_BY_PROJECT/USER/ORGANIZATION, JOBS_TIMELINE, RESERVATIONS_TIMELINE, STREAMING_TIMELINE, TABLE_STORAGE, COLUMN_FIELD_PATHS; the query plan and execution graph; BigQuery audit logs (BigQueryAuditMetadata) for who ran what; Data Transfer run history.
  • Dataflow: job graph, system lag, data freshness, watermark age, throughput, worker CPU and memory, autoscaling chart, Dataflow monitoring interface, logs per worker, Error and Diagnostics tab, profiling (Cloud Profiler). Alert on system lag and job state.
  • Pub/Sub: subscription/num_undelivered_messages, oldest_unacked_message_age (alert when messages are stuck), ack latency, dead-letter volume.
  • Composer/Airflow: task failures, DAG run duration, scheduler heartbeat, queued tasks, worker utilisation, SLA misses.
  • Dataproc: YARN metrics, job logs, Spark history server through Component Gateway, cluster utilisation.
  • Data quality: Dataplex scans, row-count and freshness checks, lineage for impact analysis.
  • Monitor planned usage: compare actual vs forecast with budgets, quota dashboards (Quotas & System limits page) and alerts on quota usage.

Troubleshooting errors, billing and quotas

Symptom Likely cause and fix
BigQuery 403 quotaExceeded / rateLimitExceeded Hit a quota (concurrent queries, load jobs per table per day, DML concurrency, streaming rate); reduce frequency, batch, use reservations, request increase; use exponential backoff
Resources exceeded / out-of-memory in a query Large sort or join; reduce rows with filters, break the query, avoid ORDER BY on everything, avoid giant arrays; add slots
Bill spiked Look at INFORMATION_SCHEMA.JOBS by total_bytes_billed, billing export by labels and SKU; fix queries scanning unpartitioned tables, streaming inserts, or autoscaled slots left high; set budgets, alerts, max bytes billed
Query slow but small Slot contention or skew; check reservation usage and execution graph
Dataflow job stuck / lag growing Hot key, slow sink, insufficient workers, quota (IPs/CPUs), worker permission errors, failing DoFn retrying forever (streaming retries indefinitely; batch fails after 4 attempts); read worker logs and Error Reporting
Dataflow workers can’t start Missing IAM (roles/dataflow.worker), no Private Google Access, firewall blocking worker ports, subnet out of IPs, org policy
Pub/Sub messages redelivered repeatedly Ack deadline too short; consumer failing; fix deadline, add dead-letter topic
Composer DAG not appearing or failing Import error (check DAG processor logs), missing package, wrong service-account roles, worker out of memory, tasks starved by pool or concurrency settings
Dataproc job fails after scale-in Shuffle data on removed nodes; use enhanced flexibility mode or graceful decommission timeout
Permission denied on a query Needs bigquery.jobs.create in the running project plus data access; check policy tags and VPC-SC
Billing account problems Billing disabled stops services; check budgets, quotas tied to billing, the right billing account on the project
  • Quotas are per project (and some per user); request increases ahead of launch. Rate limits are different from quotas: back off and retry.

Managing workloads

  • Manage jobs (list, cancel, labels) with bq, the API, or the console; track long-running queries; cancel runaway jobs; label jobs for chargeback; use reservation assignments to steer compute; resize reservations for seasonal peaks (autoscale or scheduled commitments); use workload management policies and query queues.

Failures, fault tolerance and recovery

  • Fault tolerance and restarts: design idempotent, restartable stages; checkpoint state (Dataflow streaming checkpoints automatically; Spark structured streaming needs a Cloud Storage checkpoint directory); persist progress outside workers; use retries with exponential backoff and jitter; dead-letter queues to isolate poison data; drain streaming jobs before maintenance; update jobs in place when the pipeline is compatible; keep Pub/Sub retention to replay after outage.
  • Multi-region and multi-zone: Dataflow regional endpoints place workers across zones automatically within a region; run a second job in another region for DR of streaming (read from the same multi-region or replicated source, write to a replicated sink) and use Pub/Sub snapshot/seek to align; Dataproc clusters are zonal, so use auto-zone placement and recreate clusters in another zone (cheap with ephemeral clusters); Composer snapshots restore environments in another region.
  • Data corruption and missing data: BigQuery time travel (FOR SYSTEM_TIME AS OF, 7 days), fail-safe (7 more days), table snapshots, cross-region replicas, Cloud Storage versioning/soft delete/object holds, Cloud SQL PITR and backups, Bigtable backups and managed backups with retention, Spanner backups and PITR (up to 7 days), AlloyDB continuous backup; reprocess from raw immutable data (keep raw in Cloud Storage); validate with row counts, checksums and Dataplex quality scans; late/missing data handled with watermarks, allowed lateness, reconciliation jobs and backfills in Composer (airflow dags backfill, catchup).
  • Replication and failover:
Service Mechanism
Cloud SQL HA (regional, synchronous standby, automatic failover); read replicas and cross-region replica promotion for DR; backups and PITR
Memorystore for Redis Standard tier replica with automatic failover; Redis Cluster replicas per shard; cross-region replication (Memorystore for Redis Cluster and Valkey) for DR; RDB/AOF persistence options
Bigtable Multi-cluster replication; multi-cluster routing automatic failover; single-cluster routing manual failover
Spanner Synchronous replication in multi-region configs; automatic failover; no data loss
AlloyDB HA with standby, cross-region replication
BigQuery Cross-region dataset replication, managed disaster recovery (Enterprise Plus), snapshots
Cloud Storage Dual-region and multi-region; turbo replication for 15 min RPO
Pub/Sub Multi-zone by default; global service; retain and replay
  • Test the plan: run failover drills, game days; document RTO and RPO; monitor replication lag (Cloud SQL replica lag, Spanner and Bigtable replication latency).

Exam checklist

  • Steady critical BigQuery workloads = capacity (editions) with a dedicated reservation; spiky or small = on-demand; non-urgent queries = batch priority.
  • Reservation: baseline plus autoscale, assignments per project/folder/org and job type; idle slots are shared.
  • Prefer ephemeral Dataproc with Cloud Storage and Spot secondary workers; persistent clusters only for constant or interactive use.
  • Composer DAGs: idempotent tasks, logical date, retries, trigger_rule='all_done' to delete clusters, deferrable operators; Workflows or Scheduler for simple cases.
  • Pub/Sub alerts: oldest unacked message age; Dataflow alerts: system lag, data freshness.
  • Quota errors: batch, back off, request increase, reservations; surprise bill: INFORMATION_SCHEMA.JOBS plus billing export, max bytes billed, budgets.
  • Recovery: time travel 7 days, fail-safe 7 days, snapshots, cross-region replication, Cloud Storage versioning and dual-region, Cloud SQL HA plus replicas.
  • Streaming restarts: drain to stop cleanly; idempotent sinks; dead-letter; retention for replay.

Test what you just read. 101 practice questions on maintaining and automating workloads.

Practise this domain

All PDE notes