Skip to the workspace
Pebellslearn by building
Ingestion and Pipelines  ›  Capstone Project

Orchestration and Scheduling

Job Scheduling 12 minAn orchestrator runs a pipeline as a directed acyclic graph of tasks, starting it on a schedule but running each task only when its dependencies succeed, with retries, alerts and backfills.

data engineer / Orchestration and Scheduling

Explore each scene at your own pace.

01 · The rule

The rule

Orchestration and Scheduling

PedalCity's first pipelines ran on cron: extract rides at 02:00, build fact_rides at 02:30, refresh the dashboard at 03:00. One night the extract took 45 minutes. The build started on half-copied data, the dashboard published the wrong numbers, and nobody was alerted. The jobs ran on time. They just did not run in the right order relative to each other. An orchestrator fixes that.

The rule

Schedule the graph, not the scripts: each task runs when its inputs are ready.

An orchestrator runs a pipeline as a DAG, a directed acyclic graph. Tasks are the boxes and dependencies are the arrows. There are no loops, so there is always a finishing point.

extract_rides ────┐
extract_payments ─┼──► build_fact_rides ──┬──► build_finance_mart
extract_weather ──┘                        └──► refresh_ops_dashboard

The schedule says when the graph starts, for example daily at 02:00. The arrows decide everything else:

  • Dependencies: build_fact_rides waits until all three extracts succeed, however long they take.
  • Parallelism: the three extracts do not depend on each other, so they run at the same time.
  • Retries: a failed task retries a set number of times, with a pause between attempts, before it is marked failed.
  • Stop on failure: if a task finally fails, everything downstream waits, and someone is alerted. No wrong numbers get published.
  • Backfills: each run carries a logical date, so you can rerun the graph for 10 September, or for all of last month. This is safe only because the loads are idempotent.

Common orchestrators include Apache Airflow, Prefect, Dagster and Luigi. Their syntax differs, but all are built on these ideas.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.