Dimensional modeling is part of the Business Dimensional Lifecycle methodology developed by Ralph Kimball which includes a set of methods, techniques and concepts for use in data warehouse design.[1]:1258–1260[2] The approach focuses on identifying the key business processes within a business and modelling and implementing these first before adding additional business processes, as a bottom-up approach.[1]:1258–1260 An alternative approach from Inmon advocates a top down design of the model of all the enterprise data using tools such as entity-relationship modeling (ER).[1]:1258–1260
Dimensional modeling always uses the concepts of facts (measures), and dimensions (context). Facts are typically (but not always) numeric values that can be aggregated, and dimensions are groups of hierarchies and descriptors that define the facts. For example, sales amount is a fact; timestamp, product, register#, store#, etc. are elements of dimensions. Dimensional models are built by business process area, e.g. store sales, inventory, claims, etc. Because the different business process areas share some but not all dimensions, efficiency in design, operation, and consistency, is achieved using conformed dimensions, i.e. using one copy of the shared dimension across subject areas.
Dimensional modeling does not necessarily involve a relational database. The same modeling approach, at the logical level, can be used for any physical form, such as multidimensional database or even flat files. It is oriented around understandability and performance.
The dimensional model is built on a star-like schema or snowflake schema, with dimensions surrounding the fact table.[3][4] To build the schema, the following design model is used:
ディメンションモデリングのプロセスは、ディメンションモデルの使いやすさとデータウェアハウスの利用を確実にするための4段階の設計方法に基づいています。設計の基本は、データウェアハウスがカバーすべき実際のビジネスプロセスに基づいています。したがって、モデルの最初のステップは、モデルが構築されるビジネスプロセスを記述することです。これは、たとえば小売店での販売状況などが考えられます。ビジネスプロセスを記述するには、プレーンテキストを使用するか、基本的なビジネスプロセスモデリング表記法(BPMN)や統一モデリング言語(UML)などの他の設計ガイドを使用できます。
ビジネスプロセスを記述した後、設計の次のステップはモデルの粒度を定義することです。モデルの粒度とは、ディメンションモデルが何に焦点を当てるべきかを正確に記述したものです。例えば、「小売店の顧客伝票にある個々の明細項目」などが挙げられます。粒度の意味を明確にするために、中心となるプロセスを選択し、それを1つの文で記述する必要があります。さらに、この粒度(文)を基にディメンションテーブルとファクトテーブルを構築します。モデルが提供すべき機能に関する新たな情報が得られた場合、このステップに戻って粒度を変更する必要が生じるかもしれません。
設計プロセスの3番目のステップは、モデルのディメンションを定義することです。ディメンションは、4ステッププロセスの2番目のステップで定義した粒度内で定義する必要があります。ディメンションはファクトテーブルの基盤であり、ファクトテーブルのデータが収集される場所です。通常、ディメンションは日付、店舗、在庫などの名詞です。これらのディメンションには、すべてのデータが格納されます。たとえば、日付ディメンションには、年、月、曜日などのデータが含まれる場合があります。
ディメンションを定義したら、次のステップはファクトテーブルのキーを作成することです。このステップでは、ファクトテーブルの各行を埋める数値ファクトを特定します。このステップは、データウェアハウスに保存されているデータにアクセスできる場所であるため、システムのビジネスユーザーと密接に関係しています。したがって、ファクトテーブルの行のほとんどは、数量や単位あたりのコストなど、数値で加算可能な値になります。
次元正規化またはスノーフレーク化は、通常の次元で既知の冗長な属性を削除し、非正規化された次元を平坦化します。次元はサブ次元に厳密に結合されます。
スノーフレーキングは、多くのデータウェアハウスの哲学とは異なるデータ構造への影響をもたらします。[ 4 ] 複数の記述的(ディメンション)テーブルに囲まれた単一のデータ(ファクト)テーブル
開発者がディメンションを正規化しない理由はいくつかあります。[ 5 ]
正規化が役立つ理由についてはいくつかの議論がある。[ 4 ]階層の一部が複数の次元に共通している場合、正規化は有利になることがある。たとえば、顧客とサプライヤーの両方の次元で使用されている地理的次元は再利用できる可能性がある。
次元モデルの利点には以下が含まれます。[ 6 ]
Hadoopや同様のビッグデータフレームワークにおいても、ディメンションモデルの利点は依然として享受できます。ただし、Hadoopの一部の機能により、ディメンションモデリングの標準的なアプローチを若干調整する必要が生じます。