“Data modeling should start before you write code.” I recently read a post arguing that you have to understand the business and the structure of your data before writing SQL or defining objects in an ORM. (The author even pointed out real schemas that violated first normal form.)

The topic itself was familiar, so what caught my eye were the seven references linked in the post. I read through all seven and connected their arguments — from the Kimball methodology and history tracking to organizational debt — back to my own modeling work.

Two Decisions Kimball Settled 30 Years Ago

The Kimball methodology1 runs in four steps: pick the business process, declare the grain (the unit of aggregation), identify the dimensions (the analytical context), and identify the facts (the measurements). Tools keep changing, yet two of those steps still anchor every design.

1. Declaring the Grain

Grain defines what a single row represents. Take a convenience-store sales table. Depending on whether one row represents a full receipt, a single line item on a receipt, or a daily total per store, the questions you can answer change completely. Storing receipt line items lets you check which cigarette brand sells best. Storing only daily store totals makes product-level sales impossible to query, because item-level detail cannot be reconstructed from a daily sum. Leave the grain vague and receipt-level rows end up mixed with daily store totals in the same table, double-counting revenue. That is why Kimball put declaring the grain right at step two: both dimensions and facts depend on it.

%%{init: {"look": "classic"}}%%
flowchart TD
    A["Line-item grain · 3 rows<br/>1 row = one item on a receipt"]
    A -->|Sum by receipt| B["Receipt grain · 2 rows<br/>1 row = one receipt"]
    B -->|Sum by store and day| C["Daily store grain · 1 row<br/>1 row = store × date"]

Every level above sums to the same 4,000 KRW total. Once you store only the daily total, you cannot recover the item-level breakdown.

2. Conformed Dimensions

A conformed dimension2 aligns definitions and attribute values so multiple fact tables share a consistent analytical lens such as Customer. Sales, support, and shipping tables all involve customers. If each system assigns its own IDs and defines customer tiers differently, joining sales with support data produces mismatched counts and broken tier breakdowns. Maintaining one shared customer dimension referenced by sales, support, and shipping solves this at the table level: “VIP” means the exact same thing no matter which fact table you query.

Keeping business concepts consistent across systems is also the point I keep coming back to when explaining ontology. An ontology organizes definitions of business concepts — like Customer or Revenue — and the relationships between them in one place so multiple systems can reference the same model. Putting data from different sources onto one dashboard screen does not unify what “customer” or “revenue” means; combining query entry points and aligning definitions are two separate jobs. Conformed dimensions and ontologies share that goal. Looking back at an appliance company chatbot project where we consolidated several source systems into data marts, we did not call it ontology work at the time, yet most of the effort went into building conformed dimensions and pinning down the grain of each table.

The Kimball Group’s final Design Tip came out in 2015. Its core principles hold even when you build star schemas as dbt models and manage metric definitions in a semantic layer3 — dbt manages SQL transformations as code, while a semantic layer centralizes metric formulas and business term definitions. Adopting modern tooling does not define table grain or conformed dimensions for you; that work stays with the modeler.

LLMs need grain metadata just as much when generating SQL. Without it, a model will happily join two fact tables at different grains on a shared column name and inflate every sum. Once NL-to-SQL4 pipelines or agents start querying the warehouse directly, consistent definitions matter even more. When explaining why an organization needs an ontology, pointing to that join-and-grain failure mode persuades people far better than saying “because it’s the AI era.”

Four History-Tracking Patterns Used in Practice

Principles stay stable, while physical implementations vary widely across teams. Seattle Data Guy’s write-up on real-world data modeling walks through four patterns the author saw in production — starting with the observation that many teams claiming to use Kimball keep only the fact and dim table prefixes.

1. SCD Type 2

SCD Type 25 (Slowly Changing Dimension Type 2) preserves dimension history and was the pattern the author encountered most often. Whenever an attribute changes, you insert a new row with effective start and end dates. You need this structure when questions ask about duration itself, such as how many days an employee held a given title. To keep BETWEEN predicates clean, the author recommends setting the end date on active rows to a far-future sentinel like 9999-12-31 rather than leaving it NULL. Type 1 overwrites old values in place and loses history; Type 6 hybrids get only a brief mention from a handful of cases.

2. Daily Snapshot Partitions

Daily snapshot partitioning6 appears in the article through Facebook’s warehouse conventions. Instead of tracking dimension changes via SCD rows, the pipeline writes a full copy of the table into a new date partition every day. For an employee table, the entire roster for that day lands in its own ds (datestamp) partition. Queries skip BETWEEN range joins on start and end dates and join directly on ds. If you want to know an employee’s title on the day they clicked a page, you match the click log date to ds. Queries get simpler at the cost of higher storage usage.

%%{init: {"look": "classic"}}%%
flowchart TB
    subgraph SCD["SCD Type 2 · New row on change"]
        direction LR
        S1["Standard<br/>Start 09-01<br/>End 09-03"] -->|Tier change| S2["VIP<br/>Start 09-03<br/>End NULL"]
    end
    subgraph SNAP["Daily Snapshot · Full state each day"]
        direction LR
        D1["09-01<br/>C01 · Standard"] --- D2["09-02<br/>C01 · Standard"] --- D3["09-03<br/>C01 · VIP"]
    end
    SCD ~~~ SNAP

Customer C01 moves from Standard to VIP on 09-03. Here SCD2 treats start dates as inclusive, end dates as exclusive, and NULL as currently active. A daily snapshot alone cannot distinguish multiple state changes that happen within the same day.

3. Date-List Aggregation

Date-list aggregation7 comes from a Roblox case study. Rather than scanning raw visit logs row by row, each user record stores an array of dates the user visited. In Roblox’s case, daily scan volume dropped from petabytes to terabytes. Because individual event details are stripped out, this pattern fits retention checks and monthly active user (MAU) counts rather than event-level drill-downs.

4. Handling Fact Corrections

Fact correction patterns8 govern what happens when previously loaded numbers turn out to be wrong. Rather than running UPDATE on historical rows, pipelines either append negative reversing entries or route returns into a separate table. Using healthcare claims as an example, when an adjudication adjustment arrives, a team might replace the original claim row, append a negative offset row, or log adjustments in a dedicated table depending on how the upstream system records corrections. If the warehouse model ignores how the source system posts adjustments, queries will execute without errors and still return wrong totals.

Choosing among these patterns always weighs storage cost against query complexity. Today there is one more criterion: whether a human analyst or an LLM writes the query.

Choosing History Tracking When LLMs Write the SQL

When most questions ask for daily state and cloud storage costs are manageable, daily snapshots deserve a close look. Because “the state on date X” sits directly inside that date’s partition, explaining the join rule in a prompt stays straightforward. SCD2 requires explaining inclusive/exclusive date boundaries and, if active rows use NULL end dates, making sure the generated SQL includes OR end_date IS NULL9 — omit that clause and every currently active record drops out of the result. Checking a ds filter in generated SQL is much easier, though you still have to verify that the chosen date matches the business question, the join keys match the table grain, and nothing double-counts. If users need intraday state changes, daily snapshots alone will not be enough.

In public-sector or on-premises environments where disk capacity is tight, dimension size and retention windows drive the trade-off. Small reference tables with a few thousand rows and narrow columns — such as organization codes or diagnosis codes — cost very little to snapshot daily even across multi-year retention periods. Copying a beneficiary table with tens of millions of rows every day, on the other hand, hits storage ceilings fast. Mixing history-tracking strategies across dimensions based on row count, change frequency, and retention policy is the practical middle ground.

The Debt That Surfaces Last and Costs the Most

Joe Reis’s essay breaks the cost of modeling shortcuts into three buckets: technical debt, data debt, and organizational debt. There is no free lunch in data modeling.

Move fast with loose modeling and technical debt and data debt pile up first. Once stakeholders start questioning the numbers, trust in the data team erodes too. The moment people start saying “every team brings a different number,” the damage is done — everything the data team ships afterward gets met with skepticism first.

Spend months designing an airtight model up front and you can keep technical and data debt low, yet dragging out schedules without visible deliverables costs organizational trust from the opposite direction. Either extreme leaves you trying to win back credibility. As Reis puts it, having no model is still a model — just a bad one.

His “punch pass” metaphor for organizational patience stuck with me. Every shortcut punches one hole in your card; once the card is full, every deferred problem comes due at once. Broken trust shows up much later than broken pipelines or messy tables, and rebuilding it takes far longer than fixing code.

On one past project, a single mismatched metric during a review meeting reshaped how every subsequent deliverable was scrutinized. Nothing had crashed — two reports simply aggregated on slightly different rules — yet from that meeting onward, every number in the deck had to be re-verified from scratch. Data Warehousing Essentials makes a related point: treat data quality checks as part of the modeling deliverable itself rather than a monitoring task bolted on after pipelines go live.

Takeaways

1. Interpret the same question against the same temporal rule

“Last month’s revenue from VIP customers” yields two different numbers depending on whether “VIP” means customers who hold VIP status today or customers who held VIP status at the moment of purchase. An ontology can capture concepts and relationships like Customer and Tier, a semantic layer can hold metric formulas, and technical metadata can record tables, columns, grain, and join predicates. Before handing query generation to an LLM, verify that all three layers point to the same customer definition and the same point-in-time rule.

2. Document which questions you are giving up alongside what you skip storing

Keep only daily totals and nobody can answer item-level revenue questions six months later. Whenever you trim detail or coarsen history granularity to save storage, write down the exact questions that design can no longer answer. Having that boundary on paper separates future scope changes from design bugs.

3. Update validation queries whenever a business definition changes

Leave validation queries behind that specify how two fact tables must be pre-aggregated before joining and check that row counts and amounts do not multiply afterward. When VIP criteria change, updating the glossary document is only step one — dependent metrics, query rules, and validation checks all have to be re-run together. Operating an ontology means tracing definition changes all the way down to physical data and SQL.

4. Lock down priority metrics first and verify them end to end

Rather than waiting for every requirement across the enterprise to settle, agree with business owners on grain, point-in-time rules, and correction handling for the first set of priority metrics and verify the output early. Schedules keep moving while teams debate edge cases, so separating what locks now from what gets revisited later keeps delivery intact.

Looking back at meetings where numbers clashed, you can only explain a discrepancy when the underlying aggregation rules are explicit. Winning back an organization that has started doubting your numbers takes far more time and effort than fixing a single SQL query.

  1. Kimball methodology and star schema: A classic data warehousing approach that separates database structures into facts (numeric measurements) and dimensions (descriptive context used for filtering and grouping). ↩︎

  2. Conformed dimension & ontology: Aligning concept definitions and identifier rules — such as what counts as a “Customer” or “VIP” — across separate systems like sales, support, and shipping. ↩︎

  3. dbt & semantic layer: dbt manages SQL data transformations as versioned code, while a semantic layer centralizes business metric formulas and term definitions so downstream tools query consistent logic. ↩︎

  4. NL2SQL and grain mismatch: A common failure mode when AI translates natural-language questions into SQL and joins two tables at different aggregation levels without pre-aggregating, inflating sums and counts. ↩︎

  5. SCD Type 2 (Slowly Changing Dimension): Preserves attribute history by inserting a new row with effective start and end dates (or a sentinel such as 9999-12-31) instead of overwriting existing rows; requires careful BETWEEN range filtering in SQL. ↩︎

  6. Daily snapshot partitioning: Copies the full state of a table into a new date partition (ds) every day instead of tracking row-level intervals, trading higher storage consumption for simpler equality joins. ↩︎

  7. Date-list aggregation: Compresses user activity history into a single array column of active dates per user instead of scanning individual event rows. ↩︎

  8. Fact correction handling (reversing entries): Corrects historical data errors without UPDATE statements by appending offset rows multiplied by -1 or isolating adjustments in a separate table, similar to accounting ledgers. ↩︎

  9. Missing SQL predicate (OR end_date IS NULL): A frequent LLM query bug on SCD2 tables where omitting the null-end-date check drops all currently active records from the result set. ↩︎