Schema & Data Architecture

The semantic layer is the backbone of MeshLens — a normalized, vendor-agnostic metadata schema that models the entire data mesh lifecycle: domains, applications, connections, data products, lineage, governance, and operational health. Any organization adopting data mesh can use this schema as the single source of truth for mesh observability — regardless of the underlying warehouse or tooling.

Design Principles

Domain-Driven Ownership

Every entity belongs to a domain. Applications, data products, and governance policies carry a domain_id FK — enabling per-domain ownership, cost attribution, and health scoring.

Lineage-First Modeling

Lineage edges connect data products — not tables or columns. This gives a high-level, product-centric view of data flow (FEEDS, DERIVES, AGGREGATES) that maps directly to business understanding.

Operational Separation

Metadata tables (domain, product, lineage) are distinct from time-series operational tables (sync_log, pipeline_health). Operational data scales independently.

Entity Relationship Diagram

14 tables organized across four zones — core platform entities model the organizational structure, the data mesh layer captures products and lineage, pipeline operations track time-series health, and governance enforces policies and SLA compliance.

CORE PLATFORMDATA MESH LAYERPIPELINE OPERATIONSGOVERNANCE & QUALITY1:N1:NN:11:N1:NN:N1:N1:N1:N1:N1:N1:N1:NN:1domainidPK ⚷namedescriptionowner_teamcolor_hexcreated_atapplicationidPK ⚷nameapp_typedomain_idFK →vendorenvironmentcreated_atconnectionidPK ⚷application_idFK →destination_idFK →connector_typesync_frequencystatusmonthly_cost_usdrows_per_sync_avgdestinationidPK ⚷nametyperegiondatabase_namecreated_atdata_productidPK ⚷namedomain_idFK →product_typequality_scoresla_freshnessownerdescriptionlineage_edgeidPK ⚷source_product_idFK →target_product_idFK →edge_typedescriptionsync_logidPK ⚷connection_idFK →sync_idevent_typemessagerows_syncedbytes_syncedstarted_atcompleted_atduration_secpipeline_healthconnection_idFK →measured_atstatuslast_success_atfailure_streakavg_latency_secdata_product_consumeridPK ⚷data_product_idFK →consumer_nameconsumer_typeteamaccess_frequencydata_product_sourcedata_product_idFK →connection_idFK →table_namesync_daily_statsconnection_idFK →measured_datesyncs_completedrows_syncederrors_countavg_duration_secschema_changeidPK ⚷connection_idFK →change_typeschema_nametable_namecolumn_namedetected_atgovernance_policyidPK ⚷namepolicy_typedescriptionscopedomain_idFK →enforcedsla_breachidPK ⚷data_product_idFK →breach_typeseverityexpected_valueactual_valuedetected_atresolved_at

Schema Design

Three logical groups organize the schema — core platform entities, the data mesh product layer, and operational health with governance controls.

Core Platform

4 tables

The organizational backbone — domains own applications, applications connect to destinations through managed connections.

domain
⚷ idnamedescriptionowner_teamcolor_hexcreated_at

Business domains — the fundamental ownership and organizational unit

application
⚷ idname✓ app_type→ domain_idvendor✓ environmentcreated_at

SaaS, ERP, Database, and API systems with environment tags

destination
⚷ idname✓ typeregiondatabase_namecreated_at

Target data warehouses with region for latency considerations

connection
⚷ id→ application_id→ destination_id✓ connector_type✓ sync_frequency✓ statusmonthly_cost_usdrows_per_sync_avg

Application → Destination pipe with sync cadence, cost, and status

Data Mesh Layer

4 tables

The product layer — every data product has a type, quality score, SLA, and directional lineage edges.

data_product
⚷ idname→ domain_id✓ product_type✓ quality_scoresla_freshnessownerdescription

The mesh quantum — typed, quality-scored, and SLA-bound

lineage_edge
⚷ id→ source_product_id→ target_product_id✓ edge_typedescription

Directed edges (FEEDS, DERIVES, AGGREGATES) between products

data_product_source
→ data_product_id→ connection_idtable_name

Junction linking products to upstream connections and tables

data_product_consumer
⚷ id→ data_product_idconsumer_name✓ consumer_typeteam✓ access_frequency

Who/what consumes each product — dashboards, ML models, APIs

Pipeline Operations

4 tables

Time-series health data and sync telemetry — separated from core entities so operational data can scale independently.

sync_log
⚷ id→ connection_idsync_id✓ event_typemessagerows_syncedbytes_syncedstarted_atcompleted_atduration_sec

Event-level sync audit trail with timing and volume

sync_daily_stats
→ connection_idmeasured_datesyncs_completedrows_syncederrors_countavg_duration_sec

Pre-aggregated daily metrics — avoids expensive log scans

pipeline_health
→ connection_idmeasured_at✓ statuslast_success_atfailure_streakavg_latency_sec

Latest health snapshot — healthy, degraded, or down

schema_change
⚷ id→ connection_id✓ change_typeschema_nametable_namecolumn_namedetected_at

Column adds, drops, and renames — drift alerting

Governance & Quality

2 tables

Governance policies and SLA breach tracking — enforcing security, quality, and compliance standards across the mesh.

governance_policy
⚷ idname✓ policy_typedescription✓ scope→ domain_idenforced

RBAC, PII, retention, quality rules — domain-scoped or global

sla_breach
⚷ id→ data_product_id✓ breach_type✓ severityexpected_valueactual_valuedetected_atresolved_at

Freshness and quality SLA breaches with resolution tracking

⚷ Primary Key→ Foreign Key✓ Check Constraint

View Catalog

8 views·96 columns·10 source tables

Analytical views that power MeshLens dashboards. Select a card for schema, lineage, and query logic.

v_mesh_overview

Materialized View

Single-row mesh summary providing a global health snapshot

14Columns
8Sources
1Downstream
#Column NameTypeDescription
1domain_countINTTotal number of business domains
2app_countINTTotal registered applications across all domains
3product_countINTTotal data products (all types)
4source_productsINTCount of source-aligned data products
5business_productsINTCount of business data products
6consumer_productsINTCount of consumer-aligned data products
7connection_countINTTotal managed connections
8active_connectionsINTConnections with status = ACTIVE
9broken_connectionsINTConnections with status = BROKEN
10lineage_edgesINTTotal directed edges in lineage graph
11total_consumersINTTotal downstream consumer registrations
12overall_health_pctREAL% of pipelines in HEALTHY state (latest snapshot)
13total_monthly_cost_usdREALSum of monthly_cost_usd for non-paused connections
14open_sla_breachesINTUnresolved SLA breaches (resolved_at IS NULL)

Adopting the MeshLens Semantic Model

The MeshLens semantic model provides a practical, enterprise-ready foundation for standardizing mesh metadata across domains, data products, lineage, operational health, and governance. Its schema and views are designed to be portable across platforms such as Snowflake, BigQuery, Postgres, and other SQL-based environments, so architecture and engineering teams can adapt them to their own naming standards, ingestion pipelines, and governance requirements. Rather than forcing each tool or team to redefine core concepts, the model establishes a consistent structure that can support reporting, observability, lineage analysis, and platform operations from a shared semantic layer.

In practice, enterprises typically map their existing metadata, catalog, orchestration, and warehouse signals into these reference entities, then extend the model with additional attributes or bridge tables where needed. Core views such as v_mesh_overview and v_lineage_graph help transform raw metadata into reusable analytical outputs for BI, engineering dashboards, and custom applications, while keeping product-level lineage and operational signals aligned with business ownership and governance. The result is a common semantic contract for mesh observability that can be queried by any team and hosted on any enterprise data stack.