Markdown Editor

Dimensional Model Specification Template (Star Schema)

One star schema: business process, grain, dimensions and keys, measures with additivity, conformed dimensions, bus matrix, SCD types, load rules, tests

Data Engineering & GovernanceStandardKimball dimensional modelling concepts (The Data Warehouse Toolkit, 3rd ed., 2013, name only)dimensionalmodelspec

How to use: Use it when you design or document one fact table and its dimensions. Fill the business process and the one-sentence grain first, then dimensions, then measures. The main pitfall is mixing grains in one fact table or creating private copies of conformed dimensions.

Preview

Dimensional Model Specification: [Business process] star schema

Specification for one star schema: the business process, the declared grain, the fact table and its measures with additivity, the dimensions and their keys, conformed dimensions shared with other stars, slowly changing dimension handling per attribute, special cases (unknown members, late-arriving data, degenerate and junk dimensions), load rules, tests and the bus matrix row. Modelling vocabulary follows the dimensional modelling concepts published by Ralph Kimball and Margy Ross (The Data Warehouse Toolkit, 3rd edition, Wiley, 2013), cited by name only. Replace every [bracketed] value and every row marked Example. Worked examples use the order-line star of Corvid Commerce, a fictional SaaS retailer.

Document control

FieldValue
Document ID[DMS-SALES-001]
Version[0.1]
Status[Draft / In review / Approved / Superseded]
Technical owner[@analytics-engineer]
Business owner[@process-owner]
Approvers/reviewers[@data-architect], [@data-steward]
Physical location[Warehouse, schema]
Last updatedYYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft
[x.y]YYYY-MM-DD[@name][Change summary]

1. Business process and questions

FieldValue
Business process[Process]
Source systems[Systems and tables]
Questions answered[List]
Questions not answered here[List, with the star that answers them]

Example: Business process: a customer places an order on a Corvid storefront. Source: commerce platform order and order-line tables. Questions: units and net sales by product, category, channel, country and day; basket composition; discount depth. Not answered here: fulfilment lead times (see the fulfilment accumulating snapshot star).

2. Grain

Grain: [one row per ...]

Example: One row per order line (one product on one customer order) at the time the order is placed. Cancellations after placement overwrite order_status on the same row (no history kept on the fact) and are not separate rows; cancellation history, if needed, belongs in a separate star.

Fact table typeChoose one
TransactionOne row per event at a point in time
Periodic snapshotOne row per entity per period (day, month)
Accumulating snapshotOne row per process instance, updated at milestones
FactlessOne row records that an event or coverage occurred, with no numeric measure

Example: Transaction.

3. Dimensions

IDDimensionRole in this starSurrogate keyNatural keyConformed?Owner
DIM-DATE (Example)dim_dateOrder datedate_key (YYYYMMDD integer)Calendar dateYesData platform
DIM-CUST (Example)dim_customerOrdering customercustomer_keycustomer_idYesCustomer domain
DIM-PROD (Example)dim_productProduct orderedproduct_keyskuYesCatalogue domain
DIM-CHAN (Example)dim_channelStorefront and channelchannel_keystorefront_codeYesMarketing domain
DIM-GEO (Example)dim_geographyShipping regiongeography_keyCountry and region codeYesData platform
DIM-OFLAG (Example)dim_order_flagsJunk dimension: payment method, gift flag, first-order flagorder_flags_keyCombination of flagsNoSales domain
[DIM-nnn][Name][Role][Key][Natural key][Yes / No][@owner]

Degenerate dimensions: order_number and line_number stay on the fact table with no dimension table, so that lines of the same order can be grouped and each line identified. order_status is also kept on the fact as a degenerate attribute, with is_deleted and updated_at as load audit columns (section 7).

4. Facts and measures

IDMeasureDefinitionUnitAdditivitySource
MSR-001 (Example)quantityUnits ordered on the lineUnitsAdditive across all dimensionsorder_lines.qty
MSR-002 (Example)gross_amount_eurUnit price times quantity, converted to EUR at the order date reference rateEURAdditiveComputed
MSR-003 (Example)discount_eurDiscounts allocated to the lineEURAdditiveorder_lines.discount
MSR-004 (Example)net_amount_eurGross amount minus discount, excluding taxEURAdditiveComputed
MSR-005 (Example)unit_price_eurPrice of one unitEURNon-additive: average with care, never sumorder_lines.price, converted to EUR at the order date reference rate
[MSR-nnn][Measure][Definition][Unit][Additive / Semi-additive / Non-additive][Source]

Example: A line of 3 units at 40.00 EUR with a 12.00 EUR discount has gross_amount_eur 120.00 and net_amount_eur 108.00.

5. Conformed dimensions and bus matrix

Business process (star)DateCustomerProductChannelGeography
Orders (this star) (Example)XXXXX
Payments (Example)XXXX
Fulfilment (Example)XXXX
Stock snapshot (Example)XXX

6. Slowly changing dimension handling

Reference for the commonly used types (descriptions in original words):

TypeBehaviour when the source value changes
0Keep the original value; never change it
1Overwrite the value; no history
2Add a new dimension row with validity dates and a current flag; facts keep pointing to the version valid when they occurred
3Keep the previous value in an extra column next to the current one
4Move fast-changing attributes into a separate small dimension (mini-dimension) referenced from the fact
5Mini-dimension (type 4) plus a type 1 reference to its current row from the main dimension
6Type 2 rows that also carry a type 1 "current value" column for the same attribute
7Facts reference both the type 2 versioned key and a durable key, so reports can choose history or current values
DimensionAttributeTypeReason
dim_customer (Example)customer_segment2Sales must be reported by the segment at the time of the order
dim_customer (Example)email_hash1Only the current value is useful
dim_customer (Example)first_order_date0Never changes by definition
dim_product (Example)category2Category reorganisations must not rewrite past sales
dim_product (Example)product_name1Corrections only
[Dimension][Attribute][Type][Reason]

7. Special cases and load rules

CaseRule
Missing dimension referencePoint to the "unknown" member (key -1) and raise a data quality warning
Late-arriving dimensionInsert an inferred member with the natural key, update its attributes when the source row arrives
Late-arriving factsLook up the dimension version valid at the event time, not the current version
Corrections in sourceUpdate the fact row in place (status, amounts); keep updated_at
Deletes in sourceSet is_deleted on the fact; excluded by the semantic layer
Load frequency[Hourly / Daily], incremental on updated_at with a [3]-day lookback (Example)

8. Tests and reconciliation

IDTestRule
TST-001Grain uniquenessorder_number plus line_number is unique
TST-002Referential integrityEvery foreign key exists in its dimension (unknown member allowed)
TST-003ReconciliationDaily net_amount_eur total within [0.1]% of the finance ledger (Example)
TST-004Type 2 integrityOne current row per natural key; validity ranges do not overlap
TST-005Measure sanitynet_amount_eur equals gross_amount_eur minus discount_eur

9. References

ReferenceVersion or date checkedUse
Ralph Kimball and Margy Ross, The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling, Wiley, https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/books/data-warehouse-dw-toolkit/3rd edition (2013); checked 2026-10-30Concept names (grain, conformed dimension, bus matrix, slowly changing dimension types 0 to 7)

Standard and licence note

Structure aligned with the dimensional modelling concepts published by Ralph Kimball and Margy Ross in The Data Warehouse Toolkit, 3rd edition (Wiley, 2013). The book is copyrighted and is cited by name only; concept names are used as common vocabulary, and the descriptions, tables and examples here are original. Official text: Wiley, purchase or licensed access: https://www.kimballgroup.com/data-warehouse-business-intelligence-resources/books/data-warehouse-dw-toolkit/. Corvid Commerce is fictional. This template is original text written for this collection. Template licence: MIT.

Related templates