# Airflow Metadata Database

> The database where Airflow keeps each run. It also holds task states and settings.

**Field:** Data Engineering  
**Category:** Orchestration  
**Also known as:** Airflow Metastore, Airflow Database

## Think of it like

It is like the class book. Every name and every tick goes in it.

## Definition

The Airflow metadata database holds the state of everything in Airflow. It stores every DAG, every run and every task instance with its status. It also keeps connections, variables and XComs. The scheduler and the web page both read from it. PostgreSQL and MySQL are the usual choices in production. If it is slow or full, all of Airflow slows down.

## Example

After a year, a team's metadata database holds millions of old task rows. They clean out runs older than 90 days, and the web page is fast again.

## Why it matters

It is the memory of the whole system. Lose it, and Airflow forgets what ran, what failed and how to reach your other systems.

## Common mistake

Putting big data in it, like large XComs. The pipeline's own data goes in a warehouse or a lake.

## Three principles

- **All state.** DAGs, runs and task instances.
- **Shared hub.** The scheduler and web page read it.
- **Keep it lean.** Clean out old rows on a schedule.

## Related terms

- [Apache Airflow](https://learn.benibix.com/term/data/apache-airflow)
- [Airflow Scheduler](https://learn.benibix.com/term/data/airflow-scheduler)
- [Airflow XCom](https://learn.benibix.com/term/data/airflow-xcom)
- [PostgreSQL](https://learn.benibix.com/term/development/postgresql)
- [Airflow Connection](https://learn.benibix.com/term/data/airflow-connection)

![DAG files in a folder are read by a DAG processor into a metadata database. The scheduler reads the database, decides which tasks are ready and hands them to an executor, which runs them on workers. The web UI reads the same database.](https://learn.benibix.com/diagrams/airflow-architecture.svg)

---

Source: https://learn.benibix.com/term/data/airflow-metadata-database
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
