Docsity

Data Warehouse Design-Enterprise Applicatio Development-Lecture Handout, Exercises of Software Development

Toggle sidebar
bg1
---------------------------------------------------------------------------------------------------------------------
Data Warehouse Design
An introduction to Dimensional Modeling
Data Warehouses are not easy to build. Their design requires a way of thinking that is just
opposite to manner in which traditional computer systems are developed. Their construction
requires radical restructuring of vast amounts of data, often of dubious or inconsistent quality,
drawn from numerous heterogeneous sources.
Dimensional Modeling is the name of a logical design technique often used for data
warehouses. It is different from entity-relationship modeling. ER modeling is very useful for
transaction capture in OLTP systems.
Dimensional Modeling is the only viable technique for delivering data to the end users in a data
warehouse.
Comparison between ER and Dimensional Modeling
The characteristics of ER Model are well understood; its ability to support operational processes
is its underlying characteristic. The conventional ER models are constituted to
(a) Remove redundancy in the data model
(b) Facilitate retrieval of individual records having certain critical identifiers and
(c) Therefore, optimize online transaction processing (OLTP) performance
In contrast, the dimensional model is designed to support the reporting and analytical needs of
a data warehouse system.
Why ER is not suitable for Data Warehouses?
End user cannot understand or remember an ER Model. End User cannot navigate
an ER Model. There is no graphical user interface or GUI that takes a general ER
diagram and makes it usable by end users.
ER modeling is not optimized for complex, ad-hoc queries. They are optimized for
repetitive narrow queries
Use of ER modeling technique defeats this basic allure of data warehousing, namely
intuitive and high performance retrieval of data because it leads to highly
normalized relational tables.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Data Warehouse Design-Enterprise Applicatio Development-Lecture Handout and more Exercises Software Development in PDF only on Docsity!

Data Warehouse Design An introduction to Dimensional Modeling Data Warehouses are not easy to build. Their design requires a way of thinking that is just opposite to manner in which traditional computer systems are developed. Their construction requires radical restructuring of vast amounts of data, often of dubious or inconsistent quality, drawn from numerous heterogeneous sources. Dimensional Modeling is the name of a logical design technique often used for data warehouses. It is different from entity-relationship modeling. ER modeling is very useful for transaction capture in OLTP systems. Dimensional Modeling is the only viable technique for delivering data to the end users in a data warehouse. Comparison between ER and Dimensional Modeling The characteristics of ER Model are well understood; its ability to support operational processes is its underlying characteristic. The conventional ER models are constituted to (a) Remove redundancy in the data model (b) Facilitate retrieval of individual records having certain critical identifiers and (c) Therefore, optimize online transaction processing (OLTP) performance In contrast, the dimensional model is designed to support the reporting and analytical needs of a data warehouse system. Why ER is not suitable for Data Warehouses?  End user cannot understand or remember an ER Model. End User cannot navigate an ER Model. There is no graphical user interface or GUI that takes a general ER diagram and makes it usable by end users.  ER modeling is not optimized for complex, ad-hoc queries. They are optimized for repetitive narrow queries  Use of ER modeling technique defeats this basic allure of data warehousing, namely intuitive and high performance retrieval of data because it leads to highly normalized relational tables.

Introduction to Dimensional Modeling Concepts The objective of dimensional modeling is to represent a set of business measurements in a standard framework that is easily understandable by end users. A Dimensional model contains the same information as an ER model but packages the data in a symmetric format whose design goals are  User understandability  Query Performance  Resilience to Change

The main components of a Dimensional Model are Fact Tables and Dimension Tables. A fact table is the primary table in each dimensional model that is meant to contain measurements of the business. The most useful facts are numeric and additive. Every fact table represents a many to many relationship and every fact table contains a set of two or more foreign keys that join to their respective dimension tables. A fact depends on many factors. For example, sale_amount, a fact, depends on product, location and time. These factors are known as dimensions. Dimensions are factors on which a given fact depends. The sale_amount fact can also be thought of as a function of three variables. sales_amount = f(product, location, time) Likewise in a sales fact table we may include other facts like sales_unit and cost.

 Each dimension is stored in a dimension table and each entry is given its own unique identifier.  The dimension tables are related to one or more fact tables.  The fact table contains a composite key made up of the identifiers (primary keys) from the dimension tables.  The fact table also contains facts about the given combination of dimensions. For example a combination of store_key, date_key and product_key giving the amount of a certain product sold on a given day at a given store.  Fact table has foreign keys to all dimension tables in a star schema. In this example there are three foreign keys (date key, product key, and store key).  Fact tables are normalized, whereas dimension tables are not  Fact tables are very large as compared to dimension tables.

The facts in a star schema are of the following three types:

  1. Fully-additive
  2. Semi-additive
  3. Non-additive The facts in the above schema are fully-additive.

Snowflake and Starflake Schemas In dimensional modeling the dimension tables are in denormalized form whereas fact tables are in normalized form. Snowflaking is removing low cardinality (an attribute not having low distinct values to table cardinality ratio) textual attributes from dimension tables and placing them in secondary dimension tables. For instance, a product category can be treated this way and physically removed from the low- level product dimension table by normalizing the dimension table. This is particularly done on large dimension tables. Snowflaking a dimension means normalizing it and making it more manageable by reducing its size. But this may have an adverse effect on performance, as joins need to be performed.

A Starflake schema is a hybrid structure that contains a mixture of star and snowflake schemas.

In short, if all the dimensions in a star schema are normalized, the resulting schema is called a snowflake schema and if only a few dimensions are normalized, we call it a starflake schema. References:

  1. R. Kimball & M Ross, The Data Warehouse Toolkit, 2e, John Wiley, 2002.
  2. J.M. Firestone, Dimensional modeling and ER modeling in the Data Warehouse, http://www.dkms.com/DMERDW.html
  3. N Raden, Modeling the Data Warehouse, http://members.aol.com/nraden
  4. R. Kimball, A dimensional Modeling Manifesto, http://www.dbmsmag.com/9708d15.html