liveBook · Manning

Apache Airflow

As explained in Data Pipelines with Apache Airflow, Second Edition

Apache Airflow is an open-source platform for authoring, scheduling, and monitoring workflows, especially data pipelines.

Suppose a daily pipeline must load data, transform it, and update a model. Apache Airflow coordinates those operations as a workflow: it decides when tasks should run and which tasks must finish before others begin. The work can take place in external systems; Airflow orchestrates it rather than replacing those systems. section 1.0 section 8.0

Define a workflow as a directed acyclic graph (DAG). Tasks are its nodes, and directed edges express dependencies. A Python DAG file typically declares the tasks, their relationships, and execution metadata. Airflow parses that file to discover the workflow. Code-defined DAGs offer flexibility, including generation from configuration, but complex DAGs need careful organization to remain maintainable. section 1.2.1 section 1.3.2

Once a DAG is defined, several components turn it into scheduled work:

  • The DAG processor parses DAG files and stores their serialized structure in the metastore. section 1.2.3
  • The scheduler checks when a DAG is due and queues tasks according to their dependencies; workers execute the tasks. section 1.2.3
  • The triggerer checks completion conditions for supported asynchronous tasks. The API server provides the interface for viewing runs and mediates access to the metastore. section 1.2.3

A DAG can run hourly, daily, or on a cron-like schedule; event-triggered and irregular workflows are also possible. Airflow is particularly useful for recurring, batch-oriented pipelines, integrations with systems such as PostgreSQL and BigQuery, and backfilling earlier executions after changes. It is not designed to process individual streaming events in real time. section 1.2.3 section 1.3.1 section 1.3.2

Start locally, then investigate a failed run

In a Python virtual environment, install `apache-airflow` with `pip install apache-airflow`, then run `airflow standalone`. Open the local UI at `http://localhost:8080` using the generated admin password. The graph view shows task dependencies; the grid view shows current and historical results. If a network interruption makes a download task fail, inspect its logs, fix the connection, and clear the failed task and any downstream tasks that need rerunning. Previously successful upstream tasks need not run again. section 2.3.1 section 1.2.4 section 2.5

For more involved local setups, Docker Compose can run Airflow’s services alongside their dependencies. Production operation adds decisions about scaling, monitoring, access control, and secret encryption. A shared instance uses resources efficiently but can create ownership and failure-isolation problems; separate team instances offer isolation at the cost of more installations to manage. section 2.3.2 section 15.0 section 15.9 section 16.2

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Works through DAG execution, local setup, failure recovery, and production-operation choices rather than stopping at a tool definition.
Examples
Uses a local standalone installation, Docker Compose services, UI views, and a failed download task.
What it assumes
Assumes intermediate Python, basic Linux-terminal use, databases, SQL, and data formats; introduces Airflow’s workflow components.
What you can do after
Build it from scratch: define and run a DAG, then diagnose failed tasks and selectively rerun them through the UI.
How it connects
Connects directed acyclic graphs, task dependencies, scheduling, operators, backfilling, Docker Compose, and access control.

Also explained in

Compare how 5 books explain Apache Airflow →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.