# Data lineage

> The map of where each piece of data came from and everything that depends on it.

- Level: Advanced
- Topics: Data
- URL: https://tidbit.legios.com.ar/data-lineage/
- In Spanish: [Linaje de datos](https://tidbit.legios.com.ar/es/data-lineage/)

**Data lineage** is the record of how data moves and changes: which sources a table was built from, which jobs transformed it, and which tables, dashboards and models read it afterwards. It is usually drawn as a graph, with arrows going from raw sources on the left to reports on the right.

It answers two questions that come up every week in a data team. Looking upstream: "this revenue number looks wrong, where does it come from?" Looking downstream: "if I rename this column, what breaks?" Without lineage, both questions mean reading SQL and pipeline code by hand. With it, you click a table and see its ancestors and its descendants.

Lineage can be table-level (this table feeds that one) or column-level (this `amount` column is computed from those two columns), which is much more precise and much harder to capture. Modern tools build it automatically by parsing SQL or by having each job report what it read and wrote, often using the open standard **OpenLineage**. dbt draws lineage for its models, and data catalogs show it next to each table. It also matters for compliance: if a customer asks to be deleted under GDPR, lineage shows every place their personal data ended up.

## An analogy

The traceability label on supermarket meat: it tells you which farm, which slaughterhouse and which batch it came from, and if one farm has a problem, the store knows exactly which packages to pull from the shelves.

## Keep in mind

- Upstream lineage explains where a number comes from; downstream shows what a change will break.
- Column-level lineage is more useful than table-level, and harder to collect.
- Usually gathered automatically by parsing SQL or from jobs that report their inputs and outputs.
- OpenLineage is an open standard for sharing lineage between tools.

## Go deeper

- [Data lineage on Wikipedia](https://en.wikipedia.org/wiki/Data_lineage)
- [OpenLineage (open standard)](https://openlineage.io/)

## Related terms

- [Dashboard](https://tidbit.legios.com.ar/dashboard/): One screen of charts and numbers that shows how something is doing at a glance.
- [SQL](https://tidbit.legios.com.ar/sql/): The language you use to ask a database questions.
- [Open standard](https://tidbit.legios.com.ar/open-standard/): A public rulebook anyone can follow, so products from different makers work together.
- [dbt](https://tidbit.legios.com.ar/dbt/): A tool for writing data transformations as SQL files, with tests and docs, like software.
- [Data catalog](https://tidbit.legios.com.ar/data-catalog/): A searchable inventory of an organization's datasets, with what each one means.
- [Security compliance](https://tidbit.legios.com.ar/security-compliance/): Proving to customers and regulators, with an outside audit, that you follow security rules.
- [Personal data and GDPR](https://tidbit.legios.com.ar/personal-data-and-gdpr/): Information about you, and the laws that say who can use it and how.
