Modern stack

Apache Airflow for Data Engineers

DAGs, operators, scheduling, retries and backfills in Apache Airflow.

  • Handwritten-style
  • Diagrams and tables
  • Worked examples

Who this notebook is for

Engineers who write or maintain Airflow pipelines and candidates who get orchestration questions in interviews.

What you will be able to do

  • Write a DAG with the TaskFlow API and pass data between tasks
  • Understand scheduling, data intervals and backfills
  • Pick an executor and scale tasks without overloading the scheduler
  • Design idempotent pipelines that are safe to retry

What's inside

Pick a chapter and the notebook opens right there.

  1. Architecture & Airflow 3.xScheduler, DAG Processor, Triggerer, API Server & Metadata DB; decoupled Task SDK, Execution API, worker isolation, heartbeat misses, zombie task triage & HA multi-scheduler designStart here
  2. DAG Authoring & TaskFlow APITaskFlow API (@task) vs classic operators, type annotations, TaskGroups UI nesting, default_args inheritance, DAG parameters (Params/UI), versioning & Git-sync multi-team bundlesStart here
  3. Scheduling Semantics & TimetablesLogical date vs Data Interval (interval_start, interval_end), cron vs custom Timetables, asset-based reactive triggers, catchup storms, max_active_runs & DST timezone trapsStart here
  4. Task State & Control FlowTrigger rules (all_success, all_done, none_failed_min_one_success), branching (@task.branch), ShortCircuitOperator, depends_on_past deadlocks, exponential retries & SLA alertsStart here
  5. Data Passing & Dynamic Task MappingXCom fundamentals & DB limits, custom cloud XCom backends (S3/GCS), dynamic task mapping (expand, partial, zip), map-reduce patterns & scaling to 10k instances safelyStart here
  6. Sensors & Deferrable Operatorsmode='poke' slot starvation vs mode='reschedule', async Deferrable Operators with Triggerer asyncio daemon, ExternalTaskSensor vs ExternalTaskMarker cross-DAG triggersStart here
  7. Executors & Horizontal ScalingLocal vs Celery vs KubernetesExecutor vs Edge; K8s ephemeral pods & startup latency, concurrency knobs (pools, priority_weight, max_active_tasks) & scheduler loop tuningStart here
  8. Operators & DE Ecosystem ProvidersSQLExecuteQuery, Snowflake, BigQuery, Databricks, KubernetesPodOperator container isolation, custom operators/hooks, circuit breakers & dbt/Spark orchestration patternsStart here
  9. Secrets, Connections & PerformanceUI vs ENV vs Secrets Backends (AWS, Vault, GCP); prefix resolution, IAM roles, parsing performance benchmarks,.airflowignore & slashing parse latency from 30s to 200msStart here
  10. Idempotent Pipeline PatternsMathematical idempotency, partition overwrite (INSERT OVERWRITE), transactional staging swaps, backfill-safe engineering, late-arriving data & zero-downtime view pointersStart here
  11. Testing & Local Development CI/CDTesting pyramid, DAG integrity tests (no cycles, valid structure), unit testing tasks with dag.test(), mocking hooks/fixtures, Astro CLI dev rigs & GitHub Actions CI gatesStart here
  12. Deployment & Managed AirflowExtending official Docker images, production Helm chart tuning (PDBs, HPA), managed services matrix (MWAA vs Cloud Composer vs Astro), zero- downtime DB migrations & blue-green DAG deploysStart here
  13. Observability & OperationsRemote logging (S3, GCS, CloudWatch), StatsD/OpenTelemetry metrics, Grafana alerting, zombie pod triage, metadata DB maintenance (airflow db clean, VACUUM) & OpenLineage/MarquezStart here
  14. Security & Multi-TenancyRBAC role hierarchies, DAG-level access controls, modern Auth Managers (Keycloak, Okta, IAM Identity Center), hard K8s multi-tenant namespaces, network isolation & SOC2 audit loggingStart here
  15. Airflow vs Modern OrchestratorsComparative evaluation: Airflow vs Dagster (software- defined assets) vs Prefect vs Step Functions vs Databricks Workflows; migration runbooks & when NOT to use AirflowStart here
  16. Staff Drills & Cheat Sheet500-DAG platform architecture, 2-year backfill incident postmortem, slashing managed Airflow spend by 60%, Tier-0 SLA design, Senior DE interview deep-dive & Airflow 3.x Staff Cheat SheetStart here

Practice this

Put it to work on LakeBench.

Read the guide first

Short explainers that pair with this notebook.

Common questions

Does it cover Airflow 3?
Yes. The first chapter covers the Airflow 3.x architecture, and the later chapters use current patterns.
How does it compare Airflow with other orchestrators?
A chapter compares Airflow with modern orchestrators, so you can answer the common interview question about when to use which.
Can I read a sample before I commit?
Yes. The contents pages and the first pages of every notebook can be read online, so you can judge the style before going further.

More in Modern stack

All notebooks