Prepare and test your skills

Prepare and test your skills

Orchestrate and schedule complex data workflows is the practice of defining task order, dependencies, and timing so multi-step pipelines run reliably without manual coordination. On Google Cloud, two services divide this work by architecture: Managed Service for Apache Airflow (opens in a new tab) (formerly Cloud Composer) orchestrates data-driven batch workflows such as ETL/ELT, while Workflows orchestrates HTTP-based services into durable, stateful workflows. The choice depends on latency needs, scheduling complexity, data-passing limits, and integration with services such as BigQuery, Cloud Dataflow (Dataflow) (opens in a new tab), and Dataproc.
Managed Service for Apache Airflow is a fully managed orchestration service built on the open-source Apache Airflow project. All logic, including tasks and scheduling, is expressed in Python as Directed Acyclic Graph (DAG) definition files using a declarative state model with automatic dependency resolution. A DAG defines tasks that depend on other tasks, and the scheduler launches each task only after its upstream dependencies succeed, which enforces proper sequencing across complex pipelines.
Managed Airflow integrates with pipelines wherever they run, including on-premises and across multiple clouds. Integration with Google Cloud uses Airflow Operators to perform actions and Sensors to wait for conditions, with over 150 operators for Google Cloud alone. A typical pattern is triggering a BigQuery job from an operator task and then starting a Dataflow pipeline from a downstream task that depends on the BigQuery task, so data flows from the warehouse query to the processing job in dependency order.
Managed Airflow is designed for batch workloads that can tolerate a few seconds of latency between task executions. Scheduling uses cron-like schedules defined in the DAG file, asynchronous waiting uses polling, and parallel execution is automatic based on dependencies. Data passed between steps through XCom is limited to 48 KB, so large datasets must flow through external storage such as Cloud Storage or BigQuery rather than through the orchestrator itself. The service uses a provisioned scaling model with billing based on provisioned capacity, and it supports backfills and re-running DAGs for historical or failed intervals.
Workflows is a completely serverless service for orchestrating multiple HTTP-based services into a durable and stateful workflow. Workflows definitions use YAML or JSON syntax with imperative flow control, where the definition explicitly states each step and branch. The service offers millisecond execution latency and can handle a high number of executions, scaling up to demand and down to zero with usage-based billing per step executed.
Workflows connects systems through HTTP requests and connectors, including connectors that support simple sequences of operations in Google Cloud services such as Cloud Storage and BigQuery. Execution is started by an external trigger that invokes the workflow definition, and the workflow then calls each connected service in order. Supported trigger paths include:
Asynchronous work in Workflows uses polling, callbacks through callback endpoints, and waiting for long-running Google Cloud operations. Parallelism is supported either as concurrent executions of the same workflow or within a workflow using parallel steps. Variables passed between steps support up to 512 KB, which allows larger inline payloads than Airflow XCom but still requires external storage for bulk data movement.
Workflow dependencies control sequencing, parallelism, and failure handling across diverse data services. In Managed Airflow, the DAG declares that a downstream task depends on upstream tasks, and the scheduler resolves those dependencies automatically so independent branches run in parallel while dependent tasks wait. In Workflows, the author orders steps imperatively and adds parallel steps where branches can run together, so control flows from the trigger through each connector step to the destination system.
Scheduling differs by operational need. Managed Airflow supports cron-like schedules inside the DAG plus Sensors that wait for files, partitions, or external jobs, which fits recurring ETL/ELT that must wait for data readiness. Workflows relies on external triggers and Cloud Scheduler for timing, which fits event-driven chaining of microservices, infrastructure automation such as starting or stopping a VM, and integration with external systems. For long operations, a Workflows step can start a BigQuery job or other Google Cloud operation and then wait for completion, while a Managed Airflow operator can launch a Dataflow or Dataproc job and poll until the external service reports success.
Exam tip: Choose Managed Airflow when the workload needs backfills and re-running DAGs for historical intervals; Workflows has no backfill or re-run data-processing features and fits low-latency service chaining instead.
The comparison of Managed Airflow and Workflows options shows when to use batch orchestration versus service chaining. The two orchestrators differ in definition language, speed, scaling, and recovery features, and the correct choice follows directly from those tradeoffs:
| Feature | Workflows | Managed Service for Apache Airflow |
|---|---|---|
| Syntax | YAML or JSON with imperative flow control | Python DAG files with declarative dependency resolution |
| Execution latency | Milliseconds | Seconds between tasks |
| Scaling and billing | Serverless, scales to zero; billed per step executed | Provisioned capacity; billed on provisioned capacity |
| Data processing features | No backfills or DAG re-runs | Supports backfills and re-running DAGs |
Choose Managed Airflow for data-driven ETL/ELT pipelines that need complex dependencies, cron-like batch schedules, and recovery by backfilling missed periods. Choose Workflows for chaining HTTP services and automating operational tasks where serverless scale, millisecond latency, and high execution volume matter more than batch reprocessing.
Observability for orchestrated pipelines combines orchestrator logs with service-level job monitoring. Managed Airflow integrates with Cloud Logging and Cloud Monitoring, so Airflow and DAG logs stream to the project for immediate viewing instead of waiting for logs to appear in the environment bucket, and metrics flow into dashboards and charts. Google manages hardening, patching, and auto-upgrades for the environment infrastructure including the GKE cluster and Cloud SQL database, while the customer maintains DAG code compatibility, version upgrades, and IAM permissions for the environment service account.
When orchestration launches Dataflow jobs, the Dataflow monitoring interface shows each job in Running, Succeeded, or Failed states and provides the job graph, execution details, job metrics, estimated cost, autoscaling charts, turnkey alerts, pipeline logs, and data sampling. This lets an operator trace a failure from the orchestrator task that launched the Dataflow job to the specific Dataflow step, worker log, and performance bottleneck that caused pipeline lag or errors in sources and sinks.
Manage pipeline failures and ensure reliability is the practice of designing data pipelines to detect errors early, isolate bad data without stopping good data, and recover automatically to meet recovery goals. On Google Cloud, reliability combines clear service-level objectives (SLOs), continuous observability, idempotent processing logic, dead-letter handling, and tested disaster recovery (DR) (opens in a new tab) patterns. Together these controls keep data integrity intact when code, data, or dependent services fail.
Reliability goals translate business impact into measurable technical targets that guide pipeline design and alerting. For each key performance indicator (KPI) such as revenue influenced by recommendations, customer churn, or user engagement, teams define corresponding reliability metrics such as request success rate, response latency, irrelevant or harmful output rate, and successful task completion rate. For training workloads the metrics shift to throughput and efficiency signals such as model FLOPS utilization (MFU), iterations per second, tokens per second, and tokens per device.
SLOs quantify acceptable reliability from the user's perspective so engineering effort focuses on behavior that matters most. Example SLO targets include 99.9% of API calls must return a successful response, 95th percentile inference latency must be below 300 ms, time to first token (TTFT) must be below 500 ms for 99% of requests, and rate of harmful output must be below 0.1%. Aligning SLOs to business needs turns reliability into a measurable property that determines when a pipeline violates its objective and when recovery action is required.
Monitoring pipeline health means tracking infrastructure and application behavior continuously with the four golden signals. The four golden signals for pipeline applications are:
Cloud Monitoring collects, stores, and visualizes infrastructure and application metrics through pre-built and custom dashboards, including metrics from serving frameworks like vLLM or NVIDIA Triton Inference Server via Google Cloud Managed Service for Prometheus. Cloud Logging collects detailed logs from applications and infrastructure to provide context around events and errors, while Cloud Trace pinpoints latency and request flow across distributed microservices and multi-component inference pipelines. Cloud Profiler identifies bottlenecks inside function blocks to optimize resource usage and execution time, and accelerator tools like NVIDIA Data Center GPU Manager (DCGM) add per-process GPU utilization, memory, and temperature.
Idempotent pipeline logic produces correct results even when the execution service retries work after transient failures. In Apache Beam on Cloud Dataflow (opens in a new tab), the common parallel unit is a ParDo transform that runs user code packaged as a DoFn object, and many DoFn instances may run on different machines with no knowledge of each other. The Dataflow service is fault-tolerant and may retry code multiple times, create backup copies, and does not guarantee how many times a DoFn is invoked, how elements are grouped, or how many instances are created.
Because retries are expected, DoFn code should follow the pure-function model where functions do not depend on hidden or external state, have no observable side effects, and are deterministic. When exactly-once processing is used, the Dataflow service processes every element in the input PCollection exactly once from the user's perspective, but manual side effects such as writing temporary files with non-unique names can still cause duplicates or corruption during retries. Designing transforms to be pure and to avoid unsafe side effects is what makes automatic retry safe and preserves data fidelity.
Dead-letter queues isolate records that cannot be processed so one bad element does not fail an entire pipeline. Instead of stopping the job, the error-handling branch routes the failed message, its error details, and its original payload to a separate durable destination such as a Pub/Sub dead-letter topic or Cloud Storage path for later inspection and reprocessing. Google-provided Dataflow templates expose this pattern directly, for example with an output dead-letter Pub/Sub topic parameter that receives message failures from the main flow.
Delivery behavior depends on the failure type, so retry policy must match the cause. For 5xx destination errors, delivery is automatically retried with exponential backoff for a maximum of 15 minutes because the issue is likely temporary. For 401 and 403 authentication errors, retry will not help until a replacement job is launched with a valid API key or secret, and the poison messages must then be cleared from the dead-letter topic after troubleshooting. All other 4xx errors require investigation and correction of the record or request before replay.
Automated recovery keeps essential functions running with reduced performance rather than allowing a full outage when components fail. Fault isolation uses the circuit breaker pattern with thresholds based on error rate and latency to stop calling a failing component and to fall back to simpler models or cached data, which prevents cascading failures across services. Complementary resilience patterns include exponential backoffs that give overloaded services time to recover and load shedding that preserves core paths.
Redundancy and orchestration provide the failover path that graceful degradation depends on. Critical compute runs redundantly through Google Kubernetes Engine (GKE) multi-zone or regional clusters and Cloud Run services across regions, with Cloud Load Balancing routing traffic from unhealthy instances to healthy instances. Data redundancy uses Cloud Storage multi-regional buckets, while training resilience uses asynchronous checkpointing and Pathways resilient training to resume after failures. For scheduling, recurrent execution uses Dataflow data pipelines, Cloud Scheduler with retries for temporary 503 launch failures, the Apache Airflow Dataflow Operator in Cloud Composer, or custom cron processes on Compute Engine.
A disaster recovery pattern defines how readily the system can recover, measured against recovery time objective (RTO) and recovery point objective (RPO). RTO measures how long the system takes to resume normal operations after failure, while RPO measures how much data integrity and availability must be preserved relative to snapshots or backups before failure. Historical compliance data with a large acceptable RTO fits a lighter pattern, while an online user-facing service needs the fastest recovery and an email notification system typically falls in the middle:
| Pattern | Readiness and impact | Choose when |
|---|---|---|
| Cold | No standby capacity is running; the trip stops until help arrives to rebuild and restore | Recovery can be slow, such as historical compliance-oriented data |
| Warm | Spare capacity and kits exist but the journey must pause for repair | Recovery can tolerate brief interruption, such as non-business-critical notifications |
| Hot | Run-flat capacity continues with little immediate impact, though performance may slow | Recovery must be immediate, such as online services needing fast data and application restore |
End-to-end recovery must cover the full sequence from backup to restore to cleanup, not just archiving data. Control measures add proactive protection, such as a monitor that alerts on unexpected spikes in a data-destructive deletion pipeline and terminates the pipeline when a deletion threshold is reached. Recovery tasks must be concrete and unambiguous, such as opening a shell and running a named restore script, so responders do not guess during an incident.
Failure detection in Dataflow depends on where the failure occurs in the job lifecycle, because each stage surfaces errors in a different place. A graph construction error occurs while Dataflow builds the execution graph from pipeline code and checks for illegal operations, such as applying GroupByKey to a globally windowed unbounded PCollection without a trigger or passing the wrong type into a transform. A job validation error occurs after the service receives the graph, when it checks access to Cloud Storage staging buckets, project permissions, and input and output sources such as a missing BigQuery table. Runtime errors occur after workers start, including exceptions in ParDo instances and transient failures in dependencies like Compute Engine or Cloud Storage.
Exam tip: A graph construction error creates no job and appears only in the console where the pipeline ran, while a validation failure appears in the Dataflow monitoring interface as well as in blocking-execution output.
Verification closes the loop by proving that recovery met RTO and RPO and that alerts worked as designed. A focused investigation of a missed objective follows an ordered sequence:
After failover testing, compare restore time against RTO, compare snapshots or backups before and after failure against RPO, and confirm all services returned with minimal user disruption. Each test should document steps, timestamps, logs, and metrics, categorize bottlenecks and single points of failure by severity, update failover policies and playbooks, and share a postmortem that drives quarterly retesting under different infrastructure, software, and traffic conditions.
Design and implement observability for data pipelines is the combination of metrics, logs, dashboards, and alerting that shows pipeline health, data quality, and resource utilization. Cloud Monitoring (opens in a new tab) collects and stores metric data, visualizes it, and fires alerts, while Cloud Logging (opens in a new tab) collects, stores, and analyzes log data from every pipeline component. Together they let a pipeline emit signals, store those signals as time series or log entries, visualize trends, and notify operators when thresholds for anomalies and failures are met.
Metric collection in Cloud Monitoring is the foundation for tracking pipeline health, throughput, and resource saturation. Cloud Monitoring automatically collects system metrics for most Google Cloud services, and additional collection depends on agents and instrumentation that forward data to Cloud Monitoring for storage as time series. Queries for charts and alerting policies are built from menus in the Google Cloud console or written in Prometheus Query Language (PromQL) with syntax checks and suggestions.
Pipeline-relevant metric sources span built-in signals, agents, custom instrumentation, and log-derived counts. The sources flow from producers to Cloud Monitoring storage and then to charts and alerts:
The Ops Agent path depends on the agent running on the worker and on permissions to write metrics. For Cloud Dataflow (Dataflow) (opens in a new tab) worker VMs, persistent disk, CPU, network, and process metrics flow from the worker to Cloud Monitoring only when the worker service account holds roles/monitoring.metricWriter. Monitor the four golden signals for pipeline applications — latency, traffic, error rate, and saturation of CPU, memory, GPU, or TPU — and use historical utilization in Cloud Monitoring to project quota needs and set alerts when quota usage approaches limits.
Visualization in Cloud Monitoring turns stored time series into managed dashboards, custom dashboards, and ad hoc charts for investigation. A Google Cloud-managed dashboard is created automatically when resources are instantiated or applications are registered, showing curated logs, metric data, and open alerts. A custom dashboard is created by the operator to control exactly what data appears and how it is formatted, which is required to see trends, identify outliers, and compare current data to previous data:
| Dashboard type | How it is created | When to use it |
|---|---|---|
| Google Cloud-managed dashboard | Automatically created for resources and applications | For a curated, immediate view of resource health and open alerts |
| Custom dashboard | Created in the console or API, imported from Grafana, or installed from a template | For pipeline-specific trends, outliers, data-quality views, and combined metrics, logs, and alerts |
A custom dashboard can display charts and tables of metric data, log data and error groups, charts for alerting policies, information about alerts, text, and events such as a reboot or crash that affect operation. Metrics Explorer is the chart service for quickly exploring time-series data, comparing current to previous data, displaying outliers and percentiles, and overlaying multiple metrics, with the option to save any chart to a custom dashboard. Custom dashboards are managed through the Google Cloud console or API.
A Dataflow-focused dashboard is built by selecting the Dataflow Job metric family and adding one chart per signal. The creation flow runs from the console to the saved widget in order:
Dataflow Job.Cloud Logging provides the detailed event context that metrics alone cannot explain, which makes it critical for data-quality monitoring and failure diagnosis. Detailed application and infrastructure logs flow from pipeline components to Cloud Logging, where they are stored in log buckets and analyzed for troubleshooting and performance analysis. For Dataflow, operational logs flow from Dataflow jobs to the _Default log bucket under the logging API service name dataflow.googleapis.com.
Retention creates a hard boundary for post-incident analysis. Information about completed or cancelled Dataflow jobs is stored for 30 days, and log-entry retention follows the retention periods for the log bucket. Log-based metrics bridge logs and monitoring by converting log patterns into countable time series that flow from Cloud Logging to Cloud Monitoring. Google-defined log-based metrics include error counts detected by a service and total log entries received by a project, while user-defined log-based metrics count business-specific log events such as schema violations or dropped rows without changing pipeline code. Choose a log-based metric when the signal already exists in logs, and choose a user-defined custom metric via API or OpenTelemetry when the signal must be instrumented directly in code.
An alerting policy in Cloud Monitoring is a rule that watches a metric query and sends notifications when values meet defined criteria. The policy defines the condition, such as CPU utilization exceeding 80% or Dataflow system lag exceeding a business threshold, and the list of people or groups to notify. Notifications flow from Cloud Monitoring to configured channels, and each notification links to a persistent incident record that stores status, links to logs, a chart of recorded metric data, labels, and duration for troubleshooting.
Supported notification channels carry the alert from the policy to responders for action:
Alerting policies are created and managed through the Google Cloud console, the Cloud Monitoring API, the Google Cloud CLI, or Terraform. Many Google Cloud services surface recommended alerts or a create-alert button on a chart, where the policy is pre-configured and the operator only supplies notification targets. For Dataflow, an alert on system lag is configured by selecting the Dataflow Job metric, choosing the Job category, and choosing the System lag metric, so every trigger creates an incident and event plus email or SMS if configured. Complement metric alerts with Error Reporting to capture exceptions, Cloud Trace to pinpoint latency across distributed pipeline stages, and Cloud Profiler to identify CPU or memory bottlenecks in production code.
Exam tip: The alerting policy is the configured threshold and notification list, while the incident is the persistent record created each time the policy fires with status, logs, chart, and duration.
Orchestration, observability, and reliability form a closed control loop for data pipelines. Orchestration defines the intended order in which tasks call BigQuery, Dataflow, and Dataproc; observability exposes whether that order met health, quality, and utilization targets through metrics, logs, dashboards, and incidents; and reliability uses idempotence, dead-letter isolation, graceful degradation, and disaster recovery to return the pipeline to its SLOs when signals show a violation.
Use Managed Service for Apache Airflow for data-driven ETL/ELT pipelines that need complex dependencies, cron-like batch schedules, and recovery by backfilling missed periods. Choose Workflows for chaining HTTP-based services and automating operational tasks where serverless scale, millisecond latency, and high execution volume matter more than batch reprocessing.
Data passed between steps through Managed Service for Apache Airflow XCom is limited to 48 KB, while variables passed between Workflows steps support up to 512 KB. Bulk data must therefore flow through external storage such as Cloud Storage or BigQuery rather than through the orchestrator itself.
The four golden signals for pipeline applications are latency, traffic, error rate, and saturation. Latency is time to respond to requests, traffic is volume of requests or workload arriving at the system, error rate is rate of failed requests or operations, and saturation is utilization of critical resources like CPU, memory, and GPU or tensor processing unit (TPU) accelerators.
A data engineering team uses Cloud Composer to orchestrate a complex daily ETL pipeline that integrates Cloud Storage, Dataproc Serverless, and BigQuery. During peak batch windows, several tasks fail abruptly with Negsignal.SIGKILL and Kubernetes worker Pod evictions. In addition, the task queue experiences severe head-of-line blocking because Airflow workers remain fully occupied while synchronously polling long-running Dataproc jobs and BigQuery queries.
Which design strategy should the team implement to optimize workflow execution and resolve these reliability issues?
Last updated