skip to content

Data Marts & the Semantic Layer

How modeled tables actually reach analysts: subject-area marts plus a semantic or metrics layer that defines each metric once so every dashboard agrees. 'Why do two dashboards report different revenue?' is the interview framing.

on this pageshow

questions

6

What is a data mart, and how is it different from the warehouse it draws from?

level: juniorimportance: must knowfreq 70%

answer

  1. who is this set of tables for?
  2. scope, vocabulary and ownership
  3. a curated slice of the warehouse
  4. built on the shared core, not on raw

basics

~20 s

A data mart is a subject-area slice of the warehouse: the facts and dimensions one business area needs, named in their vocabulary and owned by someone. The warehouse holds everything; a mart is a curated, governed subset for a specific audience.

solid answer

~50 s

A **data mart** is the presentation slice of an analytics warehouse aimed at one subject area or department — orders, subscriptions, marketing attribution — containing only the fact and dimension tables that audience actually queries, with columns renamed into their vocabulary. The warehouse (or shared core layer) holds the full modelled estate: every business process, at atomic grain, conformed across the company. A mart narrows that down for scope, naming and ownership, and it is a natural boundary for access control and for saying *who answers for these numbers*. The important qualifier is where a mart is built **from**. A mart derived from the shared conformed core stays consistent with the rest of the company. A mart a team builds straight from raw source extracts because the shared model was inconvenient is how an organisation ends up with five different revenue numbers — the fix is a shared core plus thin marts on top, not more marts.

code

text · 9 lines
text
raw/            source extracts, untouched
core/           conformed dims + atomic facts (shared, owned centrally)
  dim_customer
  dim_date
  fct_order_line
mart_finance/   selections, renames, fiscal calendar, finance measures
mart_marketing/ attribution window, campaign rollups

-- marts read from core, never from raw

go deeper

for a junior

Be ready to define a data mart in one sentence and give an example subject area such as orders or marketing attribution. Know that it is a curated subset of the warehouse, not a different kind of database.

for a middle

Explain what a mart contains versus what stays in the shared core, and why building a mart directly from raw source extracts causes numbers to diverge. Be able to contrast subject-area with departmental scoping.

for a senior

Show judgment about mart proliferation: when a team's request belongs in their mart, when it belongs in the shared core, and how you keep the governed path fast enough that teams don't fork it. Expect to talk about ownership and access boundaries.

for a principal

Own the platform shape: how many marts the organisation can support, who is accountable for each, and how mart boundaries survive reorgs. Be ready to argue for subject-area substrate with thin department views rather than one mart per team.

## What a data mart is A **data mart** is the part of an analytics platform that an actual analyst points a BI tool at. It is a curated set of fact and dimension tables scoped to one **subject area** (orders, subscriptions, support tickets, web sessions) or one **department** (finance, marketing, supply chain). It contains the tables that audience queries, at the grains they query them at, with names in their language — `net_revenue`, not `amt_net_calc_v3`. Physically a mart is not a special technology. It may be a schema in the same warehouse, a separate database, a set of views, or a folder of models in a transformation project. "Data mart" is a **scoping, naming and ownership** decision, not a storage format. ## What it is not: the whole warehouse The warehouse — or the shared modelled core beneath the marts — holds the complete estate: every business process modelled at atomic grain, with dimensions shared across processes. It is deliberately broad, deliberately neutral, and deliberately not shaped for any one audience. Two consequences follow: - **Breadth.** A finance analyst should not have to navigate four hundred tables to find the three they need. A mart is the answer to "which tables are mine?" - **Neutrality.** The core cannot encode finance's definition of a closed period *and* marketing's, because they differ. The mart is where an audience's particular business rules and vocabulary get applied. ## Subject-area marts versus departmental marts Subject-area marts follow business processes, which are stable: a company still takes orders after a reorg. Departmental marts follow the org chart, which is not stable — when marketing splits into growth and lifecycle, a `marketing` mart has to be carved up or grow two owners. The practical compromise is subject-area marts as the substrate, with thin department-facing views or a semantic-layer scope on top. That keeps the expensive part (the modelled facts and dimensions) organised around durable things and the cheap part (naming and selection) organised around whoever is asking this quarter. ## Where a mart is built from — the decision that matters A mart built **on top of the shared modelled core** inherits its conformance: the same customer dimension, the same date dimension, the same atomic fact rows. Two such marts can be reconciled, because they descend from the same rows. A mart built **directly from source extracts** by one team — because the shared model lacked a column, or the request queue was six weeks long — is a second, private implementation of the same business logic. It will diverge, and it will diverge silently, because nothing joins the two together to reveal the gap. This is the classic siloed-mart failure, and note that the root cause is usually organisational (the shared path was too slow) rather than technical. If you find yourself refusing such marts, you also have to make the governed path fast enough to use. ## What belongs in a mart, and what does not Belongs: selections and renames of core tables; joins pre-resolved for convenience; measures that only this audience needs; business rules genuinely specific to this audience (finance's fiscal calendar, marketing's attribution window). Does not belong: a re-derivation of an atomic fact from raw with slightly different filters; a private copy of a shared dimension with locally-edited attributes; a business rule that three other departments will also need — that one belongs in the shared core so everyone inherits it. ## Marts and the semantic layer are complements A **semantic layer** defines metrics, dimensions and join paths once, so consuming tools ask for `net_revenue by month` rather than writing SQL. It is not a replacement for marts, and marts are not a replacement for it: - A semantic layer over an ungoverned pile of tables still returns wrong numbers — it just returns them consistently. - Marts without a semantic layer still let every dashboard re-derive metrics with its own filters. In a modern stack you usually have both: modelled core → marts → semantic layer → tools. ## In an interview Define it in one sentence, then immediately say what it is built from and who owns it. The follow-up is almost always some version of "a team wants their own mart because ours doesn't fit — what do you do?", and the expected answer is: find out whether the missing thing is genuinely audience-specific (fine, put it in their mart) or generally useful (put it in the core), and never let a second copy of the atomic facts appear.

  • A team asks to build their mart straight from source extracts because the shared model is missing a column. What do you say?
    Ask whether the missing thing is genuinely theirs alone or generally useful. Audience-specific rules and renames belong in their mart; a missing attribute or a business rule others need belongs in the shared core so everyone inherits it. What I won't accept is a second derivation of the atomic facts from raw — that is how two revenue numbers appear. If the shared path is too slow to use, that is the problem to fix.
  • Should a mart contain atomic rows, or only summarised ones?
    It should be able to reach the atomic grain, even if most queries hit coarser tables. If the mart only holds summaries, every unanticipated question — a drill into one customer, one order, one refund — has to leave the mart and go somewhere else, and the answers stop matching. Summaries are an addition on top of atomic access, never a replacement for it.
  • Does having a semantic layer make data marts unnecessary?
    No — they solve different problems. Marts decide which modelled tables an audience sees and who owns them; the semantic layer decides how a metric is computed over those tables. A semantic layer pointed at ungoverned, inconsistent tables produces consistently wrong numbers, and marts with no semantic layer still let each dashboard invent its own filters.

saying these in an interview costs you the question

  • Calls a mart a separate OLTP database for a department
  • Thinks a mart is mainly a performance cache of query results
  • Builds each mart from raw sources instead of the shared core
  • Says a mart holds only aggregates, never atomic rows
  • Treats mart and semantic layer as competing alternatives

context

open as a page

Two dashboards report different revenue for the same month — how do you diagnose and fix it?

level: seniorimportance: must knowfreq 62%

basics

~20 s

Put the two queries side by side and find where they differ: filters, join grain, which date column, currency handling, and which dimension version. Then agree one owner and one definition, migrate both dashboards to it, and add a reconciliation test.

open as a page

What is a semantic layer in an analytics stack, and what does it define once?

level: middleimportance: should knowfreq 58%

basics

~20 s

A semantic layer sits between physical tables and consumers, defining metrics, dimensions and join paths once in one reviewed place. Tools request a metric by name instead of writing their own SQL, so every report computes it identically.

open as a page

Should a derived metric live as a mart column or as a semantic-layer definition?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Materialise additive components in the mart and define the metric over them in the semantic layer. Store a computed metric in a column only when it must be frozen, is too expensive to compute at read time, or is consumed by tools that cannot reach the layer.

open as a page

How do you govern metric definitions so every team and BI tool reports the same number?

level: principalimportance: should knowfreq 36%

basics

~20 s

Give every metric a named business owner, keep its definition in version control with review, publish certification status in a catalog, and make the governed path faster than writing private SQL. Governance that is slower than the workaround gets routed around.

open as a page

What is headless BI, and what does it change about where metrics are defined?

level: middleimportance: nice to knowfreq 28%

basics

~20 s

Headless BI runs the metrics layer as a standalone service with no visualisation of its own, exposed over SQL or an API. Dashboards, notebooks, spreadsheets and applications all request the same named metrics, so definitions stop living inside one vendor's tool.

open as a page