skip to content

What makes a dimension conformed across two star schemas in a warehouse?

level: juniorimportance: must knowfreq 72%

answer

  1. one label, many fact tables
  2. the same column name is not enough
  3. keys, attribute names and values must agree
  4. it is what lets two stars be compared
  5. one owner, one load, one definition

basics

~20 s

A conformed dimension is one shared dimension - the same table, or copies with identical keys, attribute names and attribute values - used by several fact tables, so grouping or filtering by it means exactly the same thing in every star.

solid answer

~50 s

Conformance is about agreement, not merely about sharing a table. A dimension is conformed across two fact tables when the keys identify the same real-world entities, the attribute names match, and the attribute values come from the same domain - `category = 'Footwear'` labels exactly the same set of products on both sides. Physically it can be one table used by both stars, a replicated copy built by a single load process and pushed to a separate mart, or a rolled-up subset of a richer dimension. The payoff is that measures from different fact tables become comparable: because both stars label their rows with the same values, you can summarise each separately and line the answers up on those labels. Without conformance, sales by category and returns by category are two different questions wearing the same words.

code

text · 10 lines
text
dim_date            dim_date
              |                   |
dim_product --+-- fact_sales      |
     |                            |
     +------------- fact_returns -+
              |
         dim_customer

-- dim_product and dim_date are conformed: one owner,
-- one key domain, identical attribute names and values.

go deeper

for a junior

Be ready to define it in one sentence and give an example: the same date or product dimension used by both a sales fact and a returns fact, with identical keys, column names and values.

for a middle

Explain the three parts of the agreement - keys, attribute names, attribute values - and the physical forms conformance can take, including a published copy or a rolled-up subset rather than one shared table.

for a senior

Show how you would prove conformance in real data with set-difference and key-mapping checks, and describe how a conformed dimension quietly breaks when a downstream mart adds a local column or relabels a value.

for a principal

Own the fact that conformance is an ownership question before it is a modelling one: a single owning load process, one durable business key, and a change path that moves every consumer at once.

## The problem conformed dimensions solve A dimensional warehouse is never one schema; it is many. Each business process - order taking, shipping, returns, inventory counting, marketing spend - gets its own fact table, and each fact table gets its own surrounding star of dimensions. Left to themselves those stars drift apart. The sales team's product dimension has a column `category` holding `Footwear`; the returns team's has `prod_group` holding `Shoes`; the marketing mart identifies a product by a SKU string while sales identifies it by an internal warehouse key. Every star answers its own questions perfectly, and no question that spans two of them can be answered at all. The conformed dimension is the agreement that prevents this drift, and it is the single mechanism that turns a collection of independently built marts into one warehouse. ## The definition A dimension is **conformed** across two or more fact tables when, for the attributes they share: - the **keys identify the same entities** - warehouse key 4471 is the same product row wherever it turns up, and the same durable business key underlies it; - the **attribute names are the same** - both sides call it `category`, not `category` on one side and `prod_group` on the other; - the **attribute values are drawn from the same domain and carry the same meaning** - `Footwear` means the same set of products in both stars, produced by the same classification rule. Notice what is *not* in the definition. Nothing requires a single physical table, nothing requires the same number of columns everywhere, and nothing is enforced by the database. Conformance is a statement about meaning that a load process is responsible for making true. ## The three legal physical shapes **One shared table.** Both fact tables reference the same `dim_product`. This is the simplest and most common form inside a single warehouse, and it is conformed by construction. **Replicated copies.** One team owns and builds the dimension; copies are published to other marts, other schemas, sometimes other platforms. This is still conformance, provided one process is the source and the copies are not edited downstream. The moment a downstream team adds a local column or relabels a value, conformance is gone. **A rolled-up subset.** A dimension can conform to a richer one by being a strict subset of its attributes and a rollup of its rows - for example a month-grain calendar that conforms to a day-grain date dimension. The subset must be exact: same attribute names, same values, no locally invented labels. ## What conformance buys you The direct payoff is the ability to combine measures that live in different fact tables. Because the sales star and the returns star both carry `dim_product.category` with the same values, you can aggregate sales by category, aggregate returns by category, and align the two summaries on the label. That alignment is the whole point: the shared dimension supplies a common vocabulary that separate fact tables can both speak. The indirect payoff is organisational. A conformed dimension has one owner, one load job and one definition. When the business reclassifies a product line, the change happens once and every report that groups by category moves together. In an unconformed estate the same reclassification is a coordinated change across every mart, and it never lands cleanly. ## What breaks without it The failure is quiet, which is what makes it dangerous. Suppose the sales mart classifies returns-eligible items under `Footwear` and the returns mart under `Shoes`. A report that puts the two side by side does not error; it shows a `Footwear` row with sales and zero returns, and a `Shoes` row with returns and no sales. Someone reads the numbers, concludes footwear has no quality problem, and acts on it. Unconformed dimensions do not produce error messages - they produce confident wrong answers. ## A concrete check ```sql -- Values present in one star's product dimension but not the other: SELECT category FROM sales_mart.dim_product EXCEPT SELECT category FROM returns_mart.dim_product; ``` If that returns rows, the two dimensions are not conformed, whatever the column names say. Running the same check on keys - do the same business keys map to the same warehouse keys - is the second half of the test. ## Common misunderstandings Conformance is not the same as denormalisation, and it is not a query-engine feature. It does not require every mart to hold every attribute; it requires that the attributes they *do* share agree. And it is not achieved by naming two tables the same thing: two `dim_customer` tables loaded from two different source systems with two different definitions of a customer are the classic example of a dimension that looks conformed on a diagram and is not conformed in the data.

  • Does a conformed dimension have to be a single physical table shared by both stars?
    No. It can be one shared table, a replicated copy published from a single owning load process, or a rolled-up subset of a richer dimension. What matters is that one process defines the keys, names and values, and that downstream copies are never locally edited. Conformance is a property of meaning, not of storage.
  • Two marts both have a dim_customer table. How would you actually prove they are conformed?
    Compare the mapping from durable business key to warehouse key on both sides and check it agrees; then run a set-difference on each shared attribute's distinct values in both directions. Any business key that maps to different rows, or any label present on one side only, is proof they are not conformed regardless of what the column names suggest.
  • If a mart needs an attribute the shared dimension does not have, what do you do?
    Add it to the owning dimension so every consumer gets it, rather than bolting a local column onto a copy. A local addition is how a conformed dimension quietly stops being conformed; if the attribute genuinely belongs to only one process, it usually belongs in that process's fact row or its own dimension, not in a private fork.

saying these in an interview costs you the question

  • Says any dimension used by two fact tables is automatically conformed
  • Thinks matching column names are sufficient for conformance
  • Claims conformance requires one single physical dimension table
  • Confuses conformed dimensions with flattening everything into one wide table
  • Treats conformance as a BI-tool setting rather than a modelling agreement

context