Skip to content

DSM — Choosing a Storage Pattern

The DSM reference describes what your storage is: tables, columns, constraints, indexes, migrations. This page is the vocabulary for why it is shaped that way.

Data modelling has eighteen widely-recognized patterns, grouped in six families. The choice between them does not depend on taste — it depends on two questions: how does the data change, and how will people use it? A dashboard, an audit trail, and an operational app ask different questions of the same data, and each calls for different trade-offs in speed, history, flexibility, and complexity.

The useful surprise: the six families are not six unrelated ideas. Every pattern is a combination of just four independent dimensions. Two patterns differ only in how those dimensions are set — which is also why they compose: a Data Vault can sit inside a Medallion pipeline, and a star schema can carry SCD2 dimensions.

Family Patterns Built for Typical consumer
Dimensional Star, Snowflake, Galaxy Questions, not updates — dashboards slice fast from any angle Analysts, BI tools
Normalized 3NF, ER model, Inmon CIF Apps that write all day; every fact stored exactly once The operational application
Data Vault Hubs, Links, Satellites Change itself — append-only pieces when you don’t control the sources Warehouse teams, auditors
Wide / Flat One Big Table, Activity Schema, Nested Speed of reading — the join is pre-paid Dashboards, product analytics
Temporal SCD Type 1, 2, 3 Time travel — deciding what happens to the old value Finance, audits, ML
Modern Medallion, Semantic layer, Anchor Pipelines, shared metrics, and volatile requirements Data platform teams

The Normalized family is DSM’s home turf: a DSM model derived from your DDD aggregates is an ER/3NF core. The other families are either derived views of that core (dimensional, wide/flat), topologies around it (Inmon CIF, Medallion), or conventions applied to its tables (Data Vault, Temporal).

Dimension The question it answers In DSM today
Role — what is this table for? Is this the event being measured, the lens to slice by, the identity, or the relationship? Not a schema field. Convey it through aggregate plus naming conventions (below).
Time — how is history kept? Overwrite? A dated row per change? One previous value beside the current one? Not a schema field. Express it with columns and constraints (below).
Topology — where does it live and flow? One app database, an EDW feeding marts, bronze-to-silver-to-gold, many sources into a bus? First-class since ADR-026: dataContainers, containerEdges (composition / streaming / gateway), access.freshness, consistency.
Lineage — where did the data come from? Is this table the source of truth, or derived — and from what? Partially: aggregate and traceability (ddd / cbrl / aspects) give provenance; migrations[].deltaFrom links schema history.

The Temporal family collapses into one dial — how much history survives a change:

  • SCD Type 1 (overwrite): plain columns, update in place. The default for operational tables; the old value is gone forever.
  • SCD Type 2 (full history): add valid_from, valid_to, and is_current columns plus a unique constraint on (business_key, valid_to). Every change closes one row and opens the next. “What was true on that date?” becomes a query.
  • SCD Type 3 (one step back): a previous_* column beside the current one. Enough for before/after comparisons, nothing more.
  • Audit table (append-only): the alternative answer to the same question — an *_audit_log table per aggregate, as in the travel-booking sample, where booking_audit_log records every booking status transition.
# Pattern Role Time Topology Lineage
1 Star fact + dimension any one serving DB copies from the core
2 Snowflake dimension (with levels) any one serving DB copies from the core
3 Galaxy facts + shared dimensions any one serving DB copies from the core
4 3NF base entities SCD optional the app DB source of truth
5 ER model design view of 3NF — blueprint only —
6 Inmon CIF integrated core history in the EDW EDW → marts from all sources
7 Hub identity insert-only multi-source bus per-row source stamp
8 Satellite attributes full history (≈ SCD2) multi-source bus per-row source stamp
9 Link relationship insert-only multi-source bus per-row source stamp
10 One Big Table derived, wide snapshot serving layer derived from many
11 Activity Schema event stream append-only one event table derived from the apps
12 Nested / struct parent + children current app or document DB source of truth
13 SCD Type 1 any table overwrite anywhere —
14 SCD Type 2 any table row per change anywhere —
15 SCD Type 3 any table previous column anywhere —
16 Medallion layers, not tables improves per layer bronze → gold layer N from N−1
17 Semantic layer no storage — a lens live, whatever is below sits on top reads everything
18 Anchor anchor + attributes history per attribute app DB —

Read the table and a pattern emerges: the families are weightings of the same four dimensions. Dimensional is mostly Role. Temporal is entirely Time. Data Vault is Role + Time + Topology together. Modern is Topology + Lineage. Normalized is the baseline with all dials near zero — and only Time genuinely requires new storage machinery; everything else is labels, connections, and recorded provenance.

  1. Who is asking? An app writing and reading one row at a time wants the Normalized family — an ER/3NF core, which is exactly what DDD-to-DSM proposals generate. People asking questions want a derived shape of that core.
  2. Do the sources keep changing under you? If tills, vendors, and schemas you don’t control keep moving, reach for Data Vault’s append-only pieces. If sources are stable, continue.
  3. Which questions? Slicing by many angles → Star (Snowflake if dimensions are huge, Galaxy for several fact types, OBT for a few burning queries). Customer behaviour → Activity Schema. Raw mess from many places → Medallion layers; teams disputing the numbers → add a Semantic layer on top.

The ContextBrew stance: one core, many shapes

Section titled “The ContextBrew stance: one core, many shapes”

DSM’s job is the operational core. Model it once — ER/3NF with the right temporal dial per table — and treat the analytical shapes as generated projections of that one core, not hand-maintained copies:

  • dsm-to-sql, dsm-to-dbml, and dsm-to-drizzle emit the physical schema and its diagram from the same model.
  • The data dictionary (dsm-to-data-dict) renders the ER picture for humans.
  • Importers (db pull, dbt, Prisma, Drizzle, SQL DDL, and the harvest pipeline) keep the core honest against reality.
  • The importance/PII grid classifies each table as core | supporting | generic and pii | non-pii — the governance lens that decides how much history and protection each pattern’s tables deserve.

Naming conventions (until the format speaks)

Section titled “Naming conventions (until the format speaks)”
Convention Signals Example
fact_* measurable events with FKs to dimensions, numeric measures fact_seat_sales
dim_* lookup lens referenced by facts; conformed when shared dim_airport
hub_* business identity only: key + load metadata hub_passenger
link_* relationship between two hubs link_passenger_flight
sat_* dated attribute history hanging off a hub sat_passenger_contact
*_audit_log append-only event history for one table booking_audit_log
valid_from / valid_to / is_current SCD2 row validity, with a unique constraint per business key —
previous_* SCD3 one-step history column previous_city

Consistent names let the generators, the data dictionary, and the next reader recognize the pattern you chose — which is the whole point of choosing it deliberately.