Metadata and modeling
Data lineage: what it is, the types and how to capture it
Contents
Data lineage is the record of where data comes from, what happens to it and where it goes. It answers the two questions every data team is asked sooner or later: “where does this number come from?” and “what breaks if we change this?”
In short
- Data lineage traces data from its sources, through the processes that move and transform it, to the reports, files and systems that use it.
- Business lineage shows the flow in business terms; technical lineage shows the tables, columns and code.
- Column-level lineage shows which source columns each target column is derived from, and how. Table-level lineage only shows that two tables are connected.
- Lineage is captured by parsing code, by recording what pipelines do at runtime, or by documenting processes. Most organizations need a mix.
- It is used for impact analysis (downstream), root-cause analysis (upstream), regulatory traceability and trust in reports.
What data lineage is
A data lineage is a graph. Its nodes are data assets (systems, files, tables, columns, reports) and the processes that move or transform data; its edges say which data flows into which, through which process.
For a single figure in a report, the lineage might read: the net interest income in the monthly management report is calculated in the reporting layer from two columns of a warehouse table; the table is loaded every night from the general ledger; the general ledger receives postings from the loan and deposit systems.
Lineage is part of metadata management. It describes data in motion, the way a data model describes data at rest.
Lineage and provenance
The two words are often used interchangeably. Strictly, provenance is the history of a particular piece of data: which inputs, which run and which version produced this value. Lineage usually describes the paths data takes in general. W3C PROV is a widely used standard vocabulary for provenance.
Why lineage matters
- Impact analysis. Before changing a column, a table or a calculation, follow the lineage downstream to see which processes, reports and interfaces will be affected, and whom to warn.
- Root-cause analysis. When a report shows a wrong figure, follow the lineage upstream to find where the error entered.
- Regulatory traceability. Regulators in banking, insurance and other sectors expect institutions to show how reported figures are derived from source data. In banking, BCBS 239 and supervisory guidance such as the ECB’s 2024 guide on risk data aggregation and risk reporting put particular weight on complete, current lineage. Critical data elements are usually the first data to need it.
- Privacy. Keeping a record of processing and answering requests from data subjects both require knowing where personal data flows. See the record of processing activities.
- Migration and decommissioning. Replacing a system means knowing everything that reads from it.
- Trust. Analysts trust a figure more when they can see where it comes from.
Kinds of lineage
Business and technical lineage
| Business lineage | Technical lineage | |
|---|---|---|
| Shows | Business processes, business terms, systems | Tables, columns, jobs, queries, code |
| Audience | Data owners, stewards, risk and compliance | Engineers, architects, operations |
| Level of detail | Summarized | Detailed |
| Example | Loan applications flow from the origination process into credit risk reporting | loan_app.amount is loaded by the job stg_load into dw.fact_loan.principal_amt |
The two are linked: a business lineage is a summarized view of the technical one, with terms from the business glossary attached to the columns.
Table-level and column-level lineage
Table-level lineage shows that table B is loaded from table A. Column-level lineage shows that the column B.total_amount is the sum of A.net_amount and A.tax_amount, filtered on A.status. Column-level lineage is what makes impact analysis precise: without it, a change to any column of a wide table appears to affect everything downstream of that table.
Direct and indirect dependencies
A column can influence a result in two ways:
- directly, when its value is copied or used in the calculation of the target;
- indirectly, when it decides which rows are included or how they are combined: columns in filters, join conditions, groupings and conditional expressions.
Both matter for impact analysis. A change to a status code used in a filter can change a report as much as a change to the amount it adds up.
Horizontal and vertical lineage
Horizontal lineage follows data from system to system. Vertical lineage links the levels of description of the same data: a business term, the logical attribute that represents it and the physical columns that store it. See conceptual, logical and physical data models.
Design-time and runtime lineage
Design-time lineage describes how data is meant to flow, from code, mappings and process documentation. Runtime lineage records how data actually flowed in a given run. Design-time lineage covers everything that could happen; runtime lineage proves what did happen, but only for the processes that are instrumented and the runs that were recorded.
How lineage is captured
| Method | How it works | Strengths | Limits |
|---|---|---|---|
| Parsing code | Reads SQL, stored procedures, ETL job definitions and transformation code, and works out the column mappings | Detailed and repeatable | Dynamic SQL, custom code and spreadsheets are hard to parse |
| Runtime events | Pipelines and orchestrators emit an event for each run with its inputs and outputs, for example in the OpenLineage format | Shows what really ran | Covers only instrumented tools; the detail varies |
| Query logs | Reads the query history of a database to see which statements read and wrote which tables | Needs no change to pipelines | Hard to tie queries to business processes |
| Documentation | Process owners record which data each process step reads and writes, with source-to-target mappings | Covers manual steps, outside parties and business meaning | Has to be kept up to date |
| Inference | Matches column names, values or patterns to suggest connections | A fast first draft | Every suggestion needs a review |
No single method covers everything. Automated methods capture the technical flows inside the platforms they understand; documentation covers manual steps, files exchanged with outside parties and the business meaning that code cannot show.
Lineage and processes
Lineage is easier to understand, and to keep current, when it is attached to processes. For each process step, record which data it creates, reads, updates, deletes or validates. A CRUD matrix of processes against entities then shows at a glance which processes touch which data, and which entities nobody creates or nobody reads.
Source-to-target mappings record, for each target column, the source columns it is derived from and the rule that derives it. They are the detailed lineage of a single process step, and integration projects often write them already.
Building lineage step by step
- Start from what matters. Pick the important outputs, such as key regulatory reports and management metrics, and trace back from them instead of trying to map everything.
- Agree on the level of detail. Column level for critical data; table or system level is often enough elsewhere.
- Harvest what can be harvested. Parse the code and collect runtime events from the platforms that support it.
- Document the rest. Fill the gaps for manual processes, spreadsheets and exchanges with outside parties.
- Link to the glossary. Map the important columns to business terms, so that business users can read the lineage.
- Keep it current. Make lineage updates part of the change process, and harvest again automatically.
- Use it. Lineage that is consulted before every change stays accurate; lineage drawn for an audit and never opened again decays.
Common mistakes
- Table-level lineage only. It shows connections, not dependencies, and makes impact analysis noisy.
- Ignoring indirect dependencies. Columns used in filters and joins change results as much as the columns that are copied.
- Leaving out manual steps. Spreadsheets, manual adjustments and files from outside parties are often where errors enter.
- Technical lineage without business context. A graph of thousands of tables answers engineers’ questions, but not those of data owners or auditors.
- A one-off exercise. Lineage drawn for a project or an audit goes out of date with the next release.
- Mapping everything first. Start from the outputs that matter and extend from there.
Frequently asked questions
What is the difference between data lineage and data provenance?
Data lineage describes the paths data takes from its sources, through processes, to the places where it is used. Provenance is the detailed history of a specific piece of data: which inputs, process runs and versions produced it. Lineage is the map; provenance is the record of one particular journey.
What is column-level lineage?
Column-level lineage shows, for each column of a table, file or report, the source columns it is derived from and the transformation between them. It is more precise than table-level lineage, which only shows that two tables are connected, and it is what makes impact analysis and root-cause analysis reliable.
What is the difference between impact analysis and root-cause analysis?
Both follow lineage, in opposite directions. Impact analysis follows it downstream from a planned change to find everything that would be affected. Root-cause analysis follows it upstream from a problem, such as a wrong figure in a report, to find where the error entered.
How do you keep data lineage up to date?
Combine automated capture with process. Harvest lineage from code and pipeline runs automatically, make documented lineage part of the change process for systems and processes, and use the lineage in everyday work such as impact analysis, so that errors are noticed and corrected.
Is data lineage required by regulation?
Some regulations require it in effect. BCBS 239 asks banks to aggregate risk data accurately and to reconcile it with source data, and supervisors expect documented lineage for key risk figures. The GDPR does not use the word, but keeping records of processing and answering data subject requests require knowing where personal data flows.