Semantic Layer
A governed abstraction over physical data tables that defines metrics, dimensions, and hierarchies as first-class objects — so “revenue” means the same thing everywhere.
Last updated: 2026-04-12
Overview
A semantic layer sits between your physical data models and your consumers (BI tools, analysts, AI tools). Instead of every dashboard reimplementing its own CAC formula or JOIN logic, the semantic layer defines these calculations once. All consumers query the definitions, not the raw tables.
Historically treated as an afterthought — something built after the dimensional model was done. That’s changed as database-native semantic layer tooling has matured: Databricks Metric Views, Snowflake Semantic Views. Metrics are now first-class database objects, not formulas buried in dashboard SQL.
What a Semantic Layer Defines
| Component | Description | Example |
|---|---|---|
| Measures | Calculations / aggregations | SUM(revenue), COUNT(DISTINCT user_id), SUM(spend) / COUNT(conversions) (CAC) |
| Dimensions | Attributes to group/filter by | campaign, channel, country, date |
| Hierarchies | Drill paths | year → quarter → month → day; country → region → city |
| Qualitative metadata | Business context, descriptions, owners | Helps AI tools and self-service users understand meaning |
Why It Matters
Without a semantic layer: “revenue” is defined in 12 dashboards, each slightly differently. Finance’s number doesn’t match Marketing’s. An analyst has to know which tables to join and which filters to apply.
With a semantic layer: One definition. Every tool that queries the semantic layer gets the same number. Analysts pick dimensions and measures without writing SQL.
Semantic Layer in Pipeline Architecture
In the medallion-architecture pattern, the semantic layer is the Gold layer:
Bronze → Silver (Kimball facts + dims) → Gold (semantic layer)
Gold serves: analysts building dashboards, business users doing self-service, AI tools pulling governed metrics. Anyone who wants pre-defined metrics without understanding the join logic.
Silver still exists for consumers who need more flexibility — data scientists building model features, analysts exploring unmodeled questions.
Modern Tooling
- Databricks Metric Views — semantic layer as a native database object in Databricks
- Snowflake Semantic Views — equivalent in Snowflake
- dbt Semantic Layer / MetricFlow — defines metrics in dbt, query via any connected tool
- Looker LookML — BI-tool-native semantic layer (historically common but vendor-locked)
The shift from BI-tool-embedded semantic layers (Looker, Tableau calcs) to database-native objects reduces vendor lock-in and centralizes definitions at the infrastructure layer.
Connections
- medallion-architecture — semantic layer maps to the Gold layer
- dimensional-modeling — semantic layer sits above and abstracts over the dimensional model
- data-warehouse — the broader system
Sources
- How I Structure My Data Pipelines — added 2026-04-12
- Local clip: How I Structure My Data Pipelines