Arquitectura de Datos

Data Mesh: Data Lineage, Traceability, and Data Provenance from Source to Consumer

Learn how to design and instrument Data Lineage in Data Mesh to trace the origin of every metric, run cross-domain impact analysis, and diagnose incidents from operational source to consumer.

Content explored 0%
18px

The indicator keeps the furthest percentage explored; marking the article complete is your choice.

At 08:30 AM on the first business day of the month, CommerceFlow's finance leadership spotted a critical anomaly: inside the finance-monthly-revenue product, the recognized_net_revenue_amount metric for Europe had dropped by 14% compared to the preliminary close estimate, even though actual commercial sales had remained steady. That exact same morning, in a parallel meeting, the Payments domain squad was planning to deprecate and drop the refunded_amount column from its confirmed-payments product because they believed no executive dashboard queried it directly.

Without cross-domain traceability, both squads were flying blind:

  1. Slow, manual upstream investigation: Finance engineers spent five hours digging through Sales and Payments repositories by hand to reconstruct which operational tables, extraction jobs, and SQL formulas fed into recognized_net_revenue_amount.
  2. Downstream impact blind spot: When Payments checked who queried confirmed-payments.refunded_amount, they saw only one direct reader: the aggregate product sales.paid_sales. They had no visibility into the fact that sales.paid_sales used that column to compute net_collected_amount and that, one hop further downstream, finance-monthly-revenue depended on net_collected_amount for the company's official income statement.

In a Data Mesh architecture, where no single central team writes all the pipelines, the Data Catalog tells us what products exist today, but we need Data Lineage to answer two vital questions: where did this exact number come from? and what will break across other domains if I change or halt this component?


Levels of Lineage, Data Provenance, and Types of Evidence

The term Data Lineage spans several capabilities depending on who is asking the question and how much granularity the answer requires. Choosing the right granularity is an engineering cost-benefit trade-off:

Granularity LevelWhat It TracksPrimary Use CaseCapture & Maintenance Cost
1. Dataset / Product-Level LineageWhich data products feed other data products or reports (confirmed-payments $\rightarrow$ paid-sales).Architectural overview of the cross-domain dependency graph and accountable owners.Low: Can be declared in YAML manifests and verified in CI/CD.
2. Job & Table-Level LineageWhich operational table, ingestion task, or specific SQL job reads input A and writes table B.Operational troubleshooting when a pipeline fails or lags behind schedule.Medium: Requires instrumenting orchestrators or execution engines (e.g., via OpenLineage events).
3. Column-Level LineageWhich input columns determine the value or filtering of an output column (refunded_amount $\rightarrow$ net_collected_amount).Fine-grained impact analysis prior to contract changes and automated propagation of privacy (PII) tags.Medium-High: Requires parsing SQL abstract syntax trees (ASTs) or explicit declarations.
4. Record-Level Data ProvenanceWhich exact execution (run_id), code commit (git_sha), and source row produced a specific output row.Strict financial/clinical audits, corrupted record forensics, and AI training reproducibility.High: Requires persisting per-row audit metadata columns or versioned storage snapshots.

Two Navigation Directions: Upstream vs. Downstream

Across the directed lineage graph, we traverse edges in two opposite directions depending on the problem at hand:

  • Upstream Lineage (toward sources): Starts from a report or target column and walks backward toward operational origins. It answers: "Why did recognized net revenue in Finance change today, and which upstream table or transformation caused it?"
  • Downstream Lineage (toward consumers): Starts from a source table or column experiencing an incident or planned change and walks forward across all direct and transitive dependents (blast radius). It answers: "If Payments modifies refunded_amount, which products in Sales and Finance will be impacted 1, 2, or 3 hops away?"

Three Planes We Must Never Confuse

Just as with data contracts, rigorous engineering distinguishes three separate planes:

  1. Declared static dependencies: What the YAML manifest or source code states that it reads and writes.
  2. Observed execution evidence: Runtime events emitted when a job actually executes in production (recording which partition it read at 08:00 UTC and how many rows it produced).
  3. Semantic correctness of data: Having a complete lineage graph does not guarantee that the data is accurate. Lineage proves that column C was computed from A and B, but it does not stop a developer from writing a + where a - belonged. Lineage complements—never replaces—automated quality tests.

End-to-End Walkthrough: Reconstructing the Lineage Graph at CommerceFlow

Let's reconstruct the complete path of data at CommerceFlow from the operational databases in Sales and Payments all the way to the monthly financial report.

[Private Operational Sources]
  sales_pg.tbl_orders              payments_pg.bank_settlements
          │                                     │
          ▼ (Job: ingest_sales_orders)          ▼ (Job: ingest_confirmed_payments)
[Source-Aligned Data Products]
  sales.sales_orders               payments.confirmed_payments
  - order_id                       - order_id
  - gross_order_amount             - settled_amount
  - tax_amount                     - refunded_amount
  - order_fulfilled_at_utc         - gateway_fee_amount
          │                        - payment_settlement_status
          └──────────────┬──────────────────────┘
                         ▼ (Job: build_paid_sales_aggregate)
             [Aggregate Data Product]
               sales.paid_sales
               - order_id
               - net_collected_amount ◄── (settled_amount - refunded_amount)
               - tax_amount
               - total_gateway_fee_amount
               - order_fulfilled_at_utc
                         │
                         ▼ (Job: build_finance_monthly_revenue)
             [Consumer-Aligned Data Product]
               finance.finance_monthly_revenue
               - accounting_period_month_utc
               - recognized_net_revenue_amount
               - net_margin_after_fees_amount

Step 1: SQL Transformation and Column-Level Dependency Types

Examine the SQL query that builds finance.finance_monthly_revenue from sales.paid_sales:

-- Job: build_finance_monthly_revenue
-- Input: sales_prod.paid_sales | Output: finance_prod.finance_monthly_revenue
SELECT
    DATE_TRUNC('month', last_payment_settled_at_utc) AS accounting_period_month_utc,
    currency_code,
    SUM(net_collected_amount - tax_amount) AS recognized_net_revenue_amount,
    SUM(net_collected_amount - tax_amount - total_gateway_fee_amount) AS net_margin_after_fees_amount
FROM sales_prod.paid_sales
WHERE paid_order_reconciliation_status IN ('PAID_IN_FULL', 'PAID_PARTIALLY_REFUNDED')
  AND order_fulfilled_at_utc IS NOT NULL
GROUP BY
    DATE_TRUNC('month', last_payment_settled_at_utc),
    currency_code;

When we analyze the column-level lineage of recognized_net_revenue_amount, we uncover two distinct types of column dependencies:

  1. Direct projection or calculation dependency (DIRECT_TRANSFORM): The numerical value is computed by subtracting sales.paid_sales.tax_amount (sourced from sales_orders.tax_amount) from sales.paid_sales.net_collected_amount (which in turn derives from confirmed_payments.settled_amount and confirmed_payments.refunded_amount).
  2. Indirect filter or predicate dependency (FILTER_PREDICATE): The columns paid_order_reconciliation_status and order_fulfilled_at_utc do not appear inside SUM(...), yet they control in the WHERE clause which rows enter the sum. In fact, the 14% drop spotted by CommerceFlow's finance leadership at the start of this article happened because a delay in syncing warehouse dispatch timestamps for Europe temporarily left order_fulfilled_at_utc as NULL, excluding those orders from recognized_net_revenue_amount. Without tracking predicate columns in WHERE and JOIN clauses, finding the root cause would have taken hours longer.

Step 2: Declarative Lineage Graph Descriptor in YAML

To document node and column dependencies in a human-readable, machine-checkable format, we represent the graph in commerceflow-lineage-graph.yaml (note: this YAML format is a didactic structure illustrating the underlying graph model; in production platforms it is paired with runtime standards such as OpenLineage):

# File: commerceflow-lineage-graph.yaml
# Purpose: Didactic representation of product-level and column-level lineage.
lineage_version: "1.0.0"

nodes:
  - id: "sales.sales_orders"
    type: "data_product"
    orientation: "source_aligned"
    owner_domain: "sales"
    upstream_sources: ["sales_pg.tbl_orders", "sales_pg.tbl_order_items"]

  - id: "payments.confirmed_payments"
    type: "data_product"
    orientation: "source_aligned"
    owner_domain: "payments"
    upstream_sources: ["payments_pg.bank_settlements"]

  - id: "sales.paid_sales"
    type: "data_product"
    orientation: "aggregate"
    owner_domain: "sales"
    producing_job: "job.build_paid_sales_aggregate"
    upstream_products:
      - "sales.sales_orders"
      - "payments.confirmed_payments"
    column_lineage:
      net_collected_amount:
        direct_inputs:
          - "payments.confirmed_payments.settled_amount"
          - "payments.confirmed_payments.refunded_amount"
        filter_inputs:
          - "payments.confirmed_payments.payment_settlement_status"
      tax_amount:
        direct_inputs:
          - "sales.sales_orders.tax_amount"
        filter_inputs: []
      order_fulfilled_at_utc:
        direct_inputs:
          - "sales.sales_orders.order_fulfilled_at_utc"
        filter_inputs: []

  - id: "finance.finance_monthly_revenue"
    type: "data_product"
    orientation: "consumer_aligned"
    owner_domain: "corporate_finance"
    producing_job: "job.build_finance_monthly_revenue"
    upstream_products:
      - "sales.paid_sales"
    column_lineage:
      recognized_net_revenue_amount:
        direct_inputs:
          - "sales.paid_sales.net_collected_amount"
          - "sales.paid_sales.tax_amount"
        filter_inputs:
          - "sales.paid_sales.order_fulfilled_at_utc"
          - "sales.paid_sales.paid_order_reconciliation_status"

Step 3: Python Engine for Downstream Impact Analysis and Upstream Root-Cause Tracing

The following Python script is self-contained (relying solely on dictionaries and queues from the Python 3.10+ standard library, with zero external dependencies) and builds the directed column-level graph to automatically compute both forward blast radius (Downstream Impact) and backward provenance (Upstream Origins):

# File: lineage_impact_analyzer.py
# Purpose: Build a directed column-level lineage graph and execute
# downstream impact analysis and upstream provenance root-cause tracing.

from collections import deque
from dataclasses import dataclass
from typing import Any


@dataclass(frozen=True)
class ColumnEdge:
    source_column: str  # Format: "domain.product.column"
    target_column: str  # Format: "domain.product.column"
    dependency_type: str  # "DIRECT_TRANSFORM" or "FILTER_PREDICATE"


class DataLineageGraph:
    def __init__(self, edges: list[ColumnEdge], product_owners: dict[str, str]) -> None:
        self.product_owners = product_owners
        self.downstream_adj: dict[str, list[ColumnEdge]] = {}
        self.upstream_adj: dict[str, list[ColumnEdge]] = {}

        for edge in edges:
            self.downstream_adj.setdefault(edge.source_column, []).append(edge)
            self.upstream_adj.setdefault(edge.target_column, []).append(edge)

    @staticmethod
    def _extract_product_id(fq_column: str) -> str:
        parts = fq_column.split(".")
        return f"{parts[0]}.{parts[1]}"

    def analyze_downstream_impact(self, changed_column: str) -> dict[str, Any]:
        """Finds all downstream columns, data products, and owners impacted by a change."""
        visited_cols: set[str] = set()
        queue: deque[tuple[str, int]] = deque([(changed_column, 0)])
        impacted_columns: list[dict[str, Any]] = []
        impacted_products: set[str] = set()
        owners_to_notify: set[str] = set()

        while queue:
            current_col, depth = queue.popleft()
            for edge in self.downstream_adj.get(current_col, []):
                next_col = edge.target_column
                if next_col not in visited_cols:
                    visited_cols.add(next_col)
                    prod_id = self._extract_product_id(next_col)
                    owner = self.product_owners.get(prod_id, "unknown-owner")
                    impacted_products.add(prod_id)
                    owners_to_notify.add(owner)
                    impacted_columns.append(
                        {
                            "column": next_col,
                            "hop_distance": depth + 1,
                            "dependency_type": edge.dependency_type,
                            "product_id": prod_id,
                            "owner": owner,
                        }
                    )
                    queue.append((next_col, depth + 1))

        return {
            "source_changed": changed_column,
            "impacted_columns": impacted_columns,
            "impacted_products": sorted(impacted_products),
            "owners_to_notify": sorted(owners_to_notify),
        }

    def trace_upstream_origins(self, target_column: str) -> list[dict[str, Any]]:
        """Traces backward across all upstream columns contributing to calculation or filtering."""
        visited_cols: set[str] = set()
        queue: deque[tuple[str, int]] = deque([(target_column, 0)])
        origins: list[dict[str, Any]] = []

        while queue:
            current_col, depth = queue.popleft()
            for edge in self.upstream_adj.get(current_col, []):
                src_col = edge.source_column
                if src_col not in visited_cols:
                    visited_cols.add(src_col)
                    origins.append(
                        {
                            "upstream_column": src_col,
                            "hop_distance": depth + 1,
                            "dependency_type": edge.dependency_type,
                            "product_id": self._extract_product_id(src_col),
                        }
                    )
                    queue.append((src_col, depth + 1))

        return origins


# --- Verification assertions for the CommerceFlow lineage engine ---
if __name__ == "__main__":
    owners_map = {
        "sales.sales_orders": "sales-dpo@commerceflow.internal",
        "payments.confirmed_payments": "payments-dpo@commerceflow.internal",
        "sales.paid_sales": "sales-dpo@commerceflow.internal",
        "finance.finance_monthly_revenue": "finance-dpo@commerceflow.internal",
    }

    commerceflow_edges = [
        # From Source-Aligned (Sales & Payments) into Aggregate (paid_sales)
        ColumnEdge(
            "payments.confirmed_payments.settled_amount",
            "sales.paid_sales.net_collected_amount",
            "DIRECT_TRANSFORM",
        ),
        ColumnEdge(
            "payments.confirmed_payments.refunded_amount",
            "sales.paid_sales.net_collected_amount",
            "DIRECT_TRANSFORM",
        ),
        ColumnEdge(
            "payments.confirmed_payments.payment_settlement_status",
            "sales.paid_sales.net_collected_amount",
            "FILTER_PREDICATE",
        ),
        ColumnEdge(
            "sales.sales_orders.tax_amount",
            "sales.paid_sales.tax_amount",
            "DIRECT_TRANSFORM",
        ),
        ColumnEdge(
            "sales.sales_orders.order_fulfilled_at_utc",
            "sales.paid_sales.order_fulfilled_at_utc",
            "DIRECT_TRANSFORM",
        ),
        # From Aggregate (paid_sales) into Consumer-Aligned (finance_monthly_revenue)
        ColumnEdge(
            "sales.paid_sales.net_collected_amount",
            "finance.finance_monthly_revenue.recognized_net_revenue_amount",
            "DIRECT_TRANSFORM",
        ),
        ColumnEdge(
            "sales.paid_sales.tax_amount",
            "finance.finance_monthly_revenue.recognized_net_revenue_amount",
            "DIRECT_TRANSFORM",
        ),
        ColumnEdge(
            "sales.paid_sales.order_fulfilled_at_utc",
            "finance.finance_monthly_revenue.recognized_net_revenue_amount",
            "FILTER_PREDICATE",
        ),
    ]

    graph = DataLineageGraph(commerceflow_edges, owners_map)

    # Case 1: Downstream impact analysis if Payments deprecates 'refunded_amount'
    impact = graph.analyze_downstream_impact("payments.confirmed_payments.refunded_amount")
    assert impact["impacted_products"] == [
        "finance.finance_monthly_revenue",
        "sales.paid_sales",
    ]
    assert "finance-dpo@commerceflow.internal" in impact["owners_to_notify"]
    assert impact["impacted_columns"][1]["hop_distance"] == 2

    # Case 2: Upstream root-cause tracing for 'recognized_net_revenue_amount'
    upstream_sources = graph.trace_upstream_origins(
        "finance.finance_monthly_revenue.recognized_net_revenue_amount"
    )
    upstream_col_names = {u["upstream_column"] for u in upstream_sources}
    # Verifies detection of both the Payments refund input and the Sales fulfillment filter
    assert "payments.confirmed_payments.refunded_amount" in upstream_col_names
    assert "sales.sales_orders.order_fulfilled_at_utc" in upstream_col_names
    print("Impact analysis verified successfully:", impact["impacted_products"])

Notice how this engine immediately solves both opening challenges:

  1. Running analyze_downstream_impact("payments.confirmed_payments.refunded_amount") reveals that 2 hops away finance.finance_monthly_revenue.recognized_net_revenue_amount is impacted, automatically adding finance-dpo@commerceflow.internal to the notification list before any contract change is approved.
  2. Running trace_upstream_origins("finance.finance_monthly_revenue.recognized_net_revenue_amount") immediately surfaces sales.sales_orders.order_fulfilled_at_utc as a FILTER_PREDICATE dependency, guiding engineers straight to the root cause of the 14% European revenue drop.

How to Capture Lineage in Practice: Standards, Tooling, and Limitations

In a modern cloud environment on AWS, no single service magically reconstructs end-to-end business lineage on its own. For example, AWS Glue Data Catalog stores physical table schemas, but by itself it does not know what an arbitrary Python script does internally or how a scheduled query in Amazon Athena transforms five columns into a financial KPI unless we capture and integrate those metadata signals.

To build reliable lineage without relying on hand-drawn diagrams that go stale, the platform combines three capture mechanisms:

  1. Static declaration in the product manifest: Every Data Product declares its consumed upstream_products in its YAML manifest, guaranteeing product-level lineage by design.
  2. SQL Abstract Syntax Tree (AST) parsing: When transformations are expressed in SQL (such as queries executed on Amazon Athena or transformation frameworks like dbt / SQLGlot), the CI/CD pipeline parses the AST of SELECT ... FROM ... JOIN ... WHERE statements to automatically extract table-level and column-level edges.
  3. Runtime instrumentation with OpenLineage: Processing jobs (such as Apache Spark jobs in AWS Glue or tasks orchestrated in Airflow) emit standardized OpenLineage JSON events upon job START and COMPLETE, recording the exact input and output datasets and run identifiers. Metadata platforms such as DataHub and OpenMetadata ingest these events and render interactive lineage graphs for engineering and business teams.

Limitations of Automated Capture to Keep in Mind

No automated lineage extractor is infallible. Automated parsing loses visibility when:

  • A developer builds dynamic SQL strings concatenated at runtime or invokes opaque user-defined functions (UDFs in Python/Java) that hide which dictionary keys they read internally.
  • Data is exported to an external third-party API or spreadsheet and re-ingested under a different identifier.
  • Teams confuse the presence of a lineage edge with business rule validity.

Three Real-World Scenarios with Different Traceability Decisions

Scenario 1: Automated Propagation of Privacy Classifications Across Domains (CommerceFlow)

  • Situation: An engineer builds a new derived product reading four columns from sales-orders and two from confirmed-payments, accidentally including a column classified as restricted_pii.
  • Lineage decision: The CI/CD policy validator traverses the Column-Level Lineage graph. If any input column in direct_inputs carries the restricted_pii classification, the computational governance policy automatically requires the derived output column to inherit restricted_pii (unless it passes through a certified irreversible aggregation function), preventing sensitive data from losing its protection tag when crossing domain boundaries.

Scenario 2: Regulatory Audit and Forensics (Record-Level Data Provenance)

  • Situation: A financial regulator asks CommerceFlow to prove exactly which bank settlement batch and which version of transformation code produced the October row in finance-monthly-revenue.
  • Lineage decision: For externally audited products, in addition to the column lineage graph, the pipeline injects three technical row-level provenance columns: _ingested_batch_id, _pipeline_run_id, and _transform_git_commit_sha. Every published row can thus be traced deterministically back to the exact Git commit and input Parquet files that generated it.

Scenario 3: When a Simpler Alternative Is Sufficient (Product-Level Lineage in Early Stages)

  • Situation: A company has just published its first 6 data products backed by straightforward 30-line SQL queries and is considering delaying delivery by six months to instrument real-time record-level and column-level lineage across every internal job.
  • Lineage decision: At this stage, declaring upstream_products in each product's YAML manifest and extracting table-level dependencies from SQL views in CI delivers 80% of the value at 10% of the cost. Fine-grained column lineage and runtime OpenLineage events can be layered in progressively as multi-hop cross-domain dependencies grow.

Using Artificial Intelligence to Extract Lineage and Analyze Impact

Large language models can speed up documenting column-level lineage for complex legacy SQL queries, provided their output is verified by an AST parser or a domain engineer.

Prompt 1: Extracting Column-Level Lineage from a Complex SQL Query

Act as a data engineer specializing in data lineage and SQL static analysis.
Context: We need to document the Column-Level Lineage of the following SQL query that builds a Data Product.

Constraints:
- Analyze all CTEs (WITH blocks), subqueries, CASE expressions, aggregations, and JOIN / WHERE clauses.
- For each column in the final SELECT clause, identify:
  1. Source tables and columns that directly contribute to its value (DIRECT_TRANSFORM).
  2. Source tables and columns used in JOIN, WHERE, or HAVING conditions that filter or condition its output (FILTER_PREDICATE).
- Do not skip intermediate hops if a column is aliased inside a CTE.

Expected output:
1. Summary table: Output Column | Direct Source Columns | Filter/Predicate Columns | Applied Transformation.
2. YAML block following the `column_lineage` structure with `direct_inputs` and `filter_inputs`.

[PASTE COMPLETE SQL QUERY]

What a human must verify: Check any column in the SQL query that lacks an explicit table alias prefix (for instance, SELECT currency_code when two tables appear in the FROM/JOIN clause), confirming against the catalog schema which input table actually supplies that column.

Prompt 2: Generating a Cross-Domain Migration Plan from Downstream Impact Output

Act as a Data Mesh governance architect.
Context: The Payments domain needs to split the `gateway_fee_amount` column in its `confirmed-payments` product into two separate columns: `fixed_processing_fee_amount` and `variable_interchange_fee_amount`.

Constraints:
- Based on the downstream impact JSON report generated by our lineage engine below, draft a coordinated cross-domain migration plan.
- Specify the exact sequence in which 1-hop (Aggregate) and 2-hop (Consumer-Aligned) products must be updated to avoid temporary inconsistencies during the transition.

[PASTE JSON OUTPUT FROM analyze_downstream_impact]

What a human must verify: Confirm deployment windows and service-level agreements (SLAs) with the Data Product Owners of each impacted domain before scheduling the sunset date for the legacy column.


Practical Application Exercises

Exercise 1: The Danger of Ignoring Predicate Dependencies (WHERE / JOIN)

An analyst reviews the lineage of recognized_net_revenue_amount in finance-monthly-revenue using a basic tool that only tracks columns inside SUM(net_collected_amount - tax_amount). Relying on that incomplete report, the Sales team modifies the logic populating order_fulfilled_at_utc (delaying its timestamp recording by 72 hours), convinced that "that timestamp column is not used in any mathematical revenue formula in Finance."

Question: Why is the Sales team's conclusion wrong, and what impact will that change have on Finance's monthly close if deployed on the 29th of the month?

Exercise 2: Tracing Sensitive Data Classifications Across the Graph

In the Sales domain, the sales-orders table includes a customer_tax_identifier column classified as restricted_pii. An analytics team creates an aggregate product b2b-orders-summary that aliases that column via SELECT customer_tax_identifier AS client_ref_code and declares it in its manifest as public_internal.

Question: How does column-level lineage enable the CI/CD pipeline to detect and block this privacy vulnerability before publication?

Exercise 3: Investigating a Cascading Freshness Incident

At 10:00 UTC, the executive dashboard displays a red alert indicating that finance.finance_monthly_revenue is stale. The Finance squad inspects its own job (job.build_finance_monthly_revenue) and sees that it ran without syntax errors at 09:30 UTC, but processed 0 new rows.

Question: Using CommerceFlow's lineage graph, describe the steps an automated upstream diagnostic should follow to pinpoint the true root cause without wasting the Finance team's time.


Reasoned Solutions to the Exercises

Solution to Exercise 1

The conclusion is wrong because it ignores predicate dependencies (FILTER_PREDICATE). Even though order_fulfilled_at_utc is neither added nor subtracted inside SUM(...), the clause WHERE order_fulfilled_at_utc IS NOT NULL and the monthly cutoff condition determine whether an order qualifies as recognized revenue for the month or is pushed into deferred revenue. Delaying order_fulfilled_at_utc by 72 hours on the 29th of the month causes every order fulfilled during the final three days of the month to be excluded from recognized revenue for that period, artificially understating accounting revenue.

Solution to Exercise 2

A governance check that inspects only the output column name (client_ref_code) will miss the fact that it contains tax identifiers. By combining privacy policy checks with column-level lineage, however, the validator traverses the edge sales.sales_orders.customer_tax_identifier (restricted_pii) -> b2b-orders-summary.client_ref_code (public_internal). Because it is a direct projection without an approved aggregation or anonymization strategy, the preventive control flags an illegal sensitivity classification downgrade along the lineage path and blocks publication of the aggregate product.

Solution to Exercise 3

The automated diagnostic walks the Upstream edges starting from finance.finance_monthly_revenue:

  1. It inspects its direct 1-hop input (sales.paid_sales) and checks when its latest partition was published.
  2. Seeing that sales.paid_sales also produced 0 new rows in its latest run, it continues 2 hops upstream to its two Source-Aligned inputs: sales.sales_orders and payments.confirmed_payments.
  3. By inspecting runtime execution events (e.g., via OpenLineage), it discovers that ingest_confirmed_payments in the Payments domain failed at 07:00 UTC due to a payment gateway timeout, causing the INNER JOIN inside sales.paid_sales to yield 0 newly reconciled orders. The alert therefore points directly to the root-cause failure in Payments two hops upstream rather than blaming the final job in Finance.

When to Apply Data Lineage and Final Summary

Building Data Lineage capabilities into your Data Mesh platform shifts from nice-to-have to mission-critical when:

  • Aggregate and Consumer-Aligned products chain transformations across two or more domains.
  • Producer squads hesitate to evolve schemas or retire legacy columns because they cannot see who depends on them downstream.
  • Mean time to diagnose (MTTD) a discrepancy in a financial or operational KPI exceeds hours of manual repository archaeology.

With Data Contracts (Article 15), the Data Catalog (Article 16), and Data Lineage (Article 17), we have completed the triad of cross-domain discovery, contractual agreement, and end-to-end traceability. In the next installment, we will move into the physical data movement and processing plane, examining how to select and implement data ingestion strategies (ETL, ELT, CDC, and Batch/Incremental) inside a Data Mesh architecture.

Loading conversation…

Keep learning