Data Lineage Graph

A data lineage graph shows where each table, column or metric comes from and what depends on it. This sample traces an e-commerce stack: two Postgres tables and Stripe charges flow through dbt staging models into a customer dimension and an orders fact, which feed three consumers.

Lineage graphs are not UML. UML covers software structure and behaviour; lineage is one of the other standard data-engineering views used alongside it, usually generated by tools such as dbt docs, OpenLineage/Marquez, DataHub or Unity Catalog.


1. The Diagram

Table lineage: sources to staging to marts to dashboardsSOURCESSTAGING (dbt)MARTSCONSUMERSpostgres.customersOLTP via CDCpostgres.ordersOLTP via CDCstripe.chargesSaaS API via Fivetranstg_customersrename, mask emailstg_ordersrename, cast, dedupestg_paymentscents to amountsdim_customersone row per customerfct_ordersone row per orderchurn_model featuresfeature storeCustomer LTV reportTableauRevenue dashboardLookerEdges are harvested from SQL (dbt ref(), OpenLineage run events), not drawn by hand.Read leftwards for provenance (where did this number come from?).Read rightwards for impact (what breaks if I change this column?).
  1. Sources. Raw tables replicated from production (CDC) and a SaaS API. Nobody should query these directly in reports.
  2. Staging. One model per source table: renames, type casts, deduplication, PII masking. Lineage here is one-to-one.
  3. Marts. dim_customers combines customers with their first order date; fct_orders combines orders, payments and the customer key. Fan-in shows business logic.
  4. Consumers. Dashboards and an ML feature set. The fan-out from the marts is the blast radius of any change.

Example question: Stripe renames a field. Follow stripe.charges rightwards and you get the exact list of models and dashboards to check: stg_payments, fct_orders, the revenue dashboard and the LTV report.

2. How to Read It

Notationsource / stagingphysical tablemart modelbusiness-facingconsumerdashboard, modelderived fromcolumn pathArrows point downstream, in the direction data flows.

Arrows point downstream. Colour the layers consistently so readers see the stage at a glance. Most tools let you click a node and highlight its upstream and downstream sets, which is the real power of lineage: a static picture is a summary, the interactive graph is the tool.

3. Variant: Column-Level Lineage

Column lineage: where does net_revenue_usd come from?stg_ordersorder_idcustomer_idamount_centscurrencystg_paymentsorder_idrefund_centsfx_ratescurrencyrate_to_usdfct_ordersorder_idcustomer_idnet_revenue_usdRevenue dashboardtile: Net revenue (USD)net_revenue_usd =(amount_cents - refund_cents) / 100* rate_to_usdjoins: stg_payments.order_id, fx_rates.currency(join keys shape rows, so most tools draw them separately)

Table lineage says fct_orders depends on three tables. Column lineage says precisely which columns: net_revenue_usd is computed from amount_cents, refund_cents and rate_to_usd. That level answers audit questions ("prove this revenue number") and tells you that dropping stg_orders.currency only matters through the join. Column lineage is parsed from SQL, so it breaks on dynamic SQL or Python transforms that tools cannot read.

4. Pros, Cons, and When to Use

Pros

Cons

When to use

When not to use

5. As Diagrams-as-Code

Mermaid flowchart LR with subgraphs per layer (dbt generates the equivalent automatically with dbt docs generate):

flowchart LR
  subgraph Sources
    src_orders[(postgres.orders)]; src_cust[(postgres.customers)]; src_chg[(stripe.charges)]
  end
  subgraph Staging
    stg_orders; stg_customers; stg_payments
  end
  subgraph Marts
    dim_customers; fct_orders
  end
  src_orders --> stg_orders
  src_cust --> stg_customers
  src_chg --> stg_payments
  stg_customers --> dim_customers
  stg_orders --> dim_customers
  stg_orders --> fct_orders
  stg_payments --> fct_orders
  dim_customers --> fct_orders
  fct_orders --> rev[Revenue dashboard]
  fct_orders --> ltv[Customer LTV report]
  dim_customers --> ltv
  dim_customers --> churn[churn_model features]