Overview
Curated: · Written: · Reviewed:
Data Pipeline Orchestration
In one line
An orchestrator releases DAG tasks in dependency order, records each attempt and recovers failed work. It does not make the data correct. Reach for it when steps depend on each other, need retries, or must be rerun for past intervals (backfills).
Key definitions
- Data interval: the window a run owns. In Airflow 2.2+ and 3.x,
logical_dateequalsdata_interval_start, and the run is created after the interval closes. - try_number: the operational attempt count. The data interval is the business identity.
- Idempotency key: a value derived from the interval, so a retried write converges on one outcome.
- Pool: a slot limit that protects one shared resource.
- Terminal-state rule: the condition that marks a run successful. A green run means that rule held, nothing more.
- Backfill: creating or rerunning runs for historical intervals.
Formulas and complexity
With unlimited concurrency, the shortest wall-clock time is set by the longest dependency path:
Worked example (durations from the question): extract_a (10) to transform (8) to report (5) is the longest path.
Load (4 min) sits on a shorter path and does not change the answer.
How it works
- The scheduler releases a task once its upstream edges succeed, for a specific data interval.
- Each attempt gets a
try_number. Retries are only safe for transient failures on idempotent work. - Writes converge through partition overwrite, a merge on a stable key, or staging plus an atomic publish.
- Pools and
max_activelimits decide how many attempts run at once.
When to use and when not to
| Situation | Orchestrator | Simpler option |
|---|---|---|
| Cross-system dependencies, partitioned backfills, lineage | yes | none |
| One independent job on a fixed schedule | optional | managed scheduler plus run-to-completion job |
| Per-partition retry and per-partition success | yes, with dynamic mapping | one all-or-nothing task |
| Waiting on an external feed | yes, with a timeout and reschedule or deferrable wait | event trigger with a producer contract |
Traps interviewers probe
- Reading wall-clock time. A backfill run today reads today's data for every interval. Fix: parameterize reads and writes by
data_interval_startanddata_interval_end. - Retrying a non-idempotent write. A retry after a partial commit duplicates rows. Fix: derive the key from the interval (for example
orders:2026-09-10), never fromtry_number. - Treating a green DAG as correct. Green proves the terminal rule held. Fix: check row counts and freshness against the producer contract before publishing.
- Letting a backfill starve live runs. Fix: cap backfill concurrency, put it on its own pool or queue, and dry-run the interval set first.
- Holding worker slots while polling. A poke-mode sensor occupies a slot for the whole wait. Fix: use reschedule or deferrable mode with a timeout.
Interview tips
Open by naming the boundary: the orchestrator sequences and tracks work, and task code owns correctness.
Expect these follow-ups:
- What does a green DAG prove?
- The task ran twice. What happens?
- The upstream data arrived late. What now?
- How do you backfill 14 months without hurting the 06:00 freshness SLA?
- A retry came after a partial commit. How do you prevent a duplicate?
30-second outline: "The orchestrator releases tasks by data interval and records each attempt. A green run means the terminal rule held, not that the data is complete. I parameterize every read and write by the interval's start and end, so retries and backfills hit the same partition. Writes are idempotent through partition overwrite or a merge on a stable key, with the key derived from the interval. Backfills get a dry run, capped concurrency and their own pool, so the live schedule keeps its slots. Row-count and freshness checks against the producer contract tell me whether the data is right."
Feedback on this overview
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.