Let’s Get Certified
Module 08 / 12 · Data pipeline orchestration

Schedule work, trace a growing backlog and recover from retries

A nightly job chains distributed processing, a warehouse query and a partner API.

Schedule work, trace a growing backlog and recover from retries

A nightly job chains distributed processing, a warehouse query and a partner API. A second flow consumes live dispatch events. Use a scheduler that can encode the dependencies and expose which stage failed.

The instructor selects a managed Airflow DAG for a Python team coordinating multiple services, retries and alerts. The following lesson inspects Dataflow execution.

Work through the decision

A worker writes an event and fails before acknowledging it. The message arrives again. How should the consumer and operator respond?

Check your reasoning

Use a stable event identity and an atomic replay-safe sink write. Check stage throughput, retry logs and unique destination counts before scaling. Increasing worker count alone can accelerate the duplicate.

Associate Data Practitioner recording · 1:19:00

Decisions and tradeoffs

Managed Airflow DAG
Express cross-service dependencies, retries and alerts in a Python DAG when the workflow justifies Airflow’s operational overhead.
BigQuery scheduled query
A recurring SQL-only operation can use a native schedule when it has no separate cross-service dependency graph.
Dataflow job graph and stage metrics
Inspect bottlenecks, system lag, throughput and worker evidence by stage before increasing capacity across the job.
Pub/Sub to BigQuery ingestion
A supported BigQuery subscription or a subscriber pipeline can deliver events to the warehouse. Match schema, delivery behavior and transformation needs.
Eventarc trigger to a handler
Route supported service events to an authorized handler for event-driven work. Make the handler safe to retry.

Interpret stage evidence before scaling

At steady state, read and sink workers each report spare CPU, but an enrichment call has a long response tail. Compare the stage rates in the exercise below with its latency distribution, logs and per-key traffic.

A small hot group can hold a window open while most workers appear idle. Check event-time progress as well as total throughput. If a partner endpoint slows all requests, bound retries and respect its service limits before increasing concurrency.

Practice each guide skill

Work through these exercises in the order of the published guide. The checklist numbers are local references.

  1. Schedule a recurring BigQuery statement with a defined execution identity and time zone. Test a retry against the same target partition.
  2. Locate the first growing Dataflow stage in the job graph and inspect lag, throughput, parallelism and per-stage errors.
  3. Correlate a stage failure with Cloud Logging entries and Cloud Monitoring metrics. Record what changed immediately before the failure.
  4. Choose a scheduled query for one SQL operation, Workflows for suitable service calls, managed Airflow for a Python DAG or Spark workflow templates for supported Spark sequences.
  5. Choose between a supported direct BigQuery subscription and a transforming subscriber. Test redelivery, schema errors and replay at the destination.
  6. Route an eligible storage or messaging event through Eventarc to an authorized handler. Pass the event ID into a retry-safe pipeline launch.

Official objectives for this lesson

Locate the backlog and replay a delivery

The stage snapshot records incoming and completed elements per minute under a steady load. Predict the growing queue and the outputs of a retried batch. Run with Python 3 and its standard library.

stages = [("read", 80, 80), ("enrich", 80, 55), ("write", 55, 55)]
for name, arrived, completed in stages:
    if arrived > completed:
        print(name, "backlog growth/min:", arrived - completed)
deliveries = [("evt-14", 8), ("evt-15", 10), ("evt-14", 8)]
ledger = {}
for key, units in deliveries:
    ledger.setdefault(key, units)
print("raw units:", sum(units for _, units in deliveries))
print("unique events:", len(ledger), "ledger units:", sum(ledger.values()))
Check the result
enrich backlog growth/min: 25
raw units: 26
unique events: 2 ledger units: 18

The first sustained mismatch is at enrichment. Investigate its worker logs, hot keys and external call latency. A stable event key prevents this identical replay from contributing twice. A real sink needs atomic deduplication and an explicit policy for conflicting revisions.

Related lesson · Trace a delay to the responsible stage

Knowledge check

Schedule work, trace a growing backlog and recover from retries quiz

Answer 3 questions. Check each answer for an explanation.

Worked example · Schedule work, trace a growing backlog and recover from retries