Lab 01 — Orchestration & Reliability Core
Phase: 13 — Orchestration, Reliability & Observability | Difficulty: ⭐⭐⭐⭐☆ | Time: 6–7 hours
The control plane of a data platform in miniature: a DAG scheduler with content-hash caching (the incrementality behind Dagster/Airflow), SLO/error-budget math, data-quality checks, and a lineage graph for blast-radius reasoning. These are the systems that turn "it ran" into "it's reliable, observable, and reproducible."
What you build
topological_order— Kahn's algorithm; reject cyclesDagRunner+content_hash— execute tasks in order, caching by content hash so only changed work re-runs (bump a task version or change a seed → that task + downstream re-execute; everything else is reused)error_budget/burn_rate— SLO/SLI reliability math (allowed failures, budget burn)freshness_ok/volume_anomaly/uniqueness_violations/referential_integrity_orphans— the core data-quality dimensionsLineage—downstream/upstream/impact(blast radius)
Key concepts
| Concept | What to understand |
|---|---|
| Topological order | dependency-respecting execution; cycles are illegal |
| Content-hash caching | re-run only what changed → cheap, safe backfills |
| Error budget | allowed = total×(1−SLO); burn rate > 1 = page-worthy |
| Data quality dims | freshness, volume, uniqueness, referential integrity |
| Lineage / impact | the blast radius of a change or incident |
Run
pip install -r requirements.txt
pytest test_lab.py -v
LAB_MODULE=solution pytest test_lab.py -v
Success criteria
- All 18 tests pass —
test_version_bump_reexecutes_task_and_downstreamandtest_second_run_uses_cachecertify the incremental-orchestration model. - You can explain why content-hash caching makes backfills reproducible and cheap.
- You can compute an error budget and a burn rate and say when to page.
Extensions
- Add retries with backoff and a task state machine (pending→running→retrying→ succeeded/failed) to the runner.
- Add a partition-aware backfill: re-run only the date partitions whose inputs changed.
- Add multi-window burn-rate alerting (fast 5-min + slow 1-hour windows) — Google SRE's alerting recipe.
- Emit lineage + run metadata as events (the seed of a lineage browser / data catalog).