And the record of when a given customer shopped in a given store would be expressed more naturally in a fact table that also showed the Time dimension. A single, combined dimension would likely be unwieldy with tens of millions of rows.
But it’s usually the right decision to model Customer and Store as separate dimensions. In the grocery store example, Customer and Store clearly will show a statistical correlation. In truth, dimensions rarely are completely independent in a strong statistical sense. We call these logical clumps dimensions and assume informally that these dimensions are independent. When you record facts - dollar sales of a grocery store purchase of an individual product, for example - you naturally divide the context into clumps named Product, Store, Time, Customer, Clerk, and several others. It’s not uncommon for the designer to add context to a set of facts partway through the implementation.Īlthough you could lump all context into a wide, logical record associated with each measured fact, you’ll usually find it convenient and intuitive to divide the context into independent logical clumps. By contrast, the context surrounding the facts is open-ended and verbose. Facts are very specific, well-defined numeric attributes. Facts are always surrounded by mostly textual context that’s true at the moment the fact is recorded. Measurements are usually numeric and taken repeatedly. Measurements and Contextĭimensional modeling begins by dividing the world into measurements and context. Contrasted with other modeling disciplines, dimensional modeling has developed an extensive portfolio of techniques for handling real-world situations. Compared to entity/relation modeling, it’s less rigorous (allowing the designer more discretion in organizing the tables) but more practical because it accommodates database complexity and improves performance. Dimensional modeling is a design discipline that straddles the formal relational model and the engineering realities of text and number data.