0% found this document useful (0 votes)
12 views36 pages

Dimensional Modelling

Uploaded by

Bhavya Bajaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views36 pages

Dimensional Modelling

Uploaded by

Bhavya Bajaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Dimensional Modeling

Symbiosis International (Deemed University)


Session Objectives
By the end of this session, you will be able to:

1. Explain the concept of dimensional modeling

2. Describe the elements of dimensional modeling

3. Illustrate difference between relational model and


dimensional model
Session Objectives
By the end of this session, you will be able to:

1. Explain the concept of Dimensional Modeling

2. Describe the elements of dimensional modeling

3. Illustrate difference between relational model and


dimensional model
What is Dimensional Modeling?
• Dimensional modeling is a database design technique
that supports business users to query data in data
warehouse system.
• The dimensional modeling is developed to be oriented to
improve the query performance and ease of use.
• The concept of Dimensional Modeling was developed by
Ralph Kimball.
• It is important to note that the dimensional modeling is
not necessary depends on relational databases.
• The dimensional modeling approach, at the logical level,
can be applied to any physical forms such as relational
and multidimensional databases.
• The dimensional data model provides a method for
making databases simple and understandable.
• A Dimensional model is designed to read, summarize,
analyze numeric information like values, balances, counts,
weights, etc. in a data warehouse.
• In contrast, relation models are optimized for addition,
updating and deletion of data in a real-time Online
Transaction System.
• For instance, in the relational mode, normalization and ER
models reduce redundancy in data.
• On the contrary, dimensional model arranges data in such
a way that it is easier to retrieve information and
generate reports.
Elements of Dimensional Model
Basically there are two elements of dimensional model i.e.
Facts and Dimensions

quarter.
1. Facts
• Facts are business measurements.
• The measures are quantitative or factual data about the
subject.
• A Fact Table in a dimensional model consists of one or
more numeric facts of importance to a business.
• The measures are generally numeric and correspond to
the "how much" or "how many" aspects of a question.
• Examples of measures are price, product sales, product
inventory, revenue, and so forth.
• Primary key in Dimension table are mapped as foreign
key in fact table.
• For a Sales business process, a measurement would be
quarterly sales number
• Examples of facts are as follows:
the number of products sold
the value of products sold
the number of products produced
the number of service calls received
2. Dimensions
• Dimensions are called contexts. Dimensions are business
descriptors that specify the facts, for example, product
name, brand, quarter, etc.
• In simple terms, they give who, what, where of a fact.
• In the Sales business process, for the fact quarterly sales
number, dimensions would be
Who – Customer Names
Where – Location
What – Product Name
• Dimensions decide the contextual background for the
facts, and they are the framework over which OLAP is
performed.
• Each dimension table contains attributes which
describes the details of the dimension
• For ex. Product dimension can contain product name,
type, price etc.
• Each dimension table may also contain hieriarchies
• For ex. Time dimension can contain time_quaterly,
time_yearly as dimensions
Example of fact table with its dimensions
Types of Dimensional Modeling Schemas
There are three types of schemas available in data
warehouse
1. Star Schema
2. Snowflake schema
3. Fact Constellation Schema
Out of the above star schema is mostly used in the data
warehouse designs.
The second mostly used data warehouse schema is snow
flake schema.
1. Star Schema
• The star schema is the simplest data warehouse schema.
• It is called star schema because the structure of star
schema resembles a star, with points radiating from the
center.
• The center of the star consists of one fact tables and the
point of the stars are the dimension or look up tables.
• Usually the fact table which contains the primary
information in the data warehouse
General structure of Star Schema
A star schema is the one in which a central fact table is surrounded by
denormalized dimensional tables.
2. Snowflake Schema
• A snow flake schema is an enhancement of star schema
by adding additional dimensions.
• It is an extension of star schema means it is more
complex than star schema.
• In snowflake schema each dimension is grouped into
multiple lookup table to eliminate the redundancy.
• For example, The product dimension can be normalized
into a product table, a product category table in
snowflake schema.
• Time dimension can be normalized into a quarter and a
month table.
• The main advantage of the snowflake schema is the
improvement in query performance due to minimized
disk storage requirements and joining smaller lookup
tables.
General structure of Snowflake Schema
3. Fact Constellation Schema
A fact constellation schema has more than one fact table.
A Fact constellation means two or more fact tables sharing
one or more dimensions. It is also called Galaxy schema.
For each star schema, it is possible to create fact
constellation schema by splitting the original star schema
into more star schemes, each of them can have few common
lookup tables.
General Structure of Fact Constellation Schema
Example of Fact Constellation Schema
Steps in Dimensional Modeling
The dimensional data model is built based on star schema
with a fact table at the center surrounded by a number of
dimension tables.
The following four-step process is commonly used in
dimensional modeling design:
1. Select the business process
2. Declare the grain
3. Identify the dimensions
4. Identify the Fact
Diagram showing steps in dimensional model
1. Select the business process to model
• Business process is daily activities performed in your
company supported by an online transaction system
(OLTP) or source system.
• In this step, we have to gather the requirements from
business users to select the business process.
• This is the “why” of building a data model
• Good examples of business processes are order
processing, shipments, materials purchasing etc.
2. Declare the grain
• After having a business process to model, we need to
declare the grain of a business process.
• Declaring grain means describing exactly what a record in
a fact table represents.
• The grains express the level of detail associating with
facts in the fact table.
• This is the “How much” of building a data model
• Sample Grain : Determine the sales of certain products in
different locations for every week.
• So, the grain is “by product by location byweek”
3. Identify the dimensions
• In this step, we add a number of dimensions that
represent all possible descriptions that take on single
values in the context of each fact in the fact table.
• Date, time, product, customer, store, etc., are several
good examples of common dimensions.
• This is the “When, Where and Who” of building a data
model.
• Sample Dimension : determine the sales of certain products in different
locations for a particular time period
• Dimensions are : Product, Location and Time
4. Identify the facts
• In the last step, we select the numeric facts that will be
loaded into the fact table.
• To identify the facts, we need to find the KPIs (Key
Performance Indicator i.e the business objectives) of the
business process or find out what we are trying to
measure.
• This is the “What” of building a data model
• Sample Facts : determine the sales of certain products in
different locations for a particular time period
• Fact here is : Sum of Sales by product by location by time
Fact Table Dimension Table
Includes more records
It contains the primary key It contains the foreign key It contains the primary key
with regard to star schema with regard to star schema with regard to star schema

When it comes to table


size it enhances vertically
It has to be generated first
includes the measurement
besides the dimension
table attributes

When it comes to
attributes, it contains data
in textual format
A schema includes less fact
tables than dimension
tables
Fact Table Dimension Table
Includes more records Includes more records Includes less records

It contains the primary key It contains the primary key It contains the primary key
with regard to star schema and foreign key with with regard to star schema
regard to star schema

When it comes to table When it comes to table When it comes to table


size it enhances vertically size it enhances vertically size it enhances
horizontally

It has to be generated first It has to be generated It has to be generated first


After dimension tables
includes the measurement includes the measurement includes the attributes
besides the dimension besides the dimension
table attributes table attributes

When it comes to When it comes to When it comes to


attributes, it contains data attributes, it contains data attributes, it contains data
in textual format in textual format as well as in textual format
numeric format

A schema includes less fact A schema includes less fact A schema includes more
tables than dimension tables than dimension dimension tables than fact
tables tables tables
Star Schema Snowflake Schema
Star Schema contains ----- and -------- Snowflake Schema contains ----, -------
TABLES and ---------TABLES
Star schema is --------------approach Snowflake Schema is -----------approach
Star schema is highly ------------ FORM Snowflake schema is -------------- FORM
Star Schema is ------ to maintain due to Snowflake Schema is -------to maintain
----------- due to ---------
Query performance is ------ Query performance -------
Star schema has -------- joins Snowflake schema has -------- of joins
Star Schema has -------- relations like -----
Snowflake Schema has ----- relations like
--------
POOR, DENORMALIZED, FACT TABLES, 1:1 / 1:M, FEWER, NORMALIZED, DIFFICULT,
DIMENSION TABLES, EASY, COMPLEX, M:M, TOP DOWN, HIGH REDUNDANCY, SUB-
DIMENSION TABLES, GOOD, MORE NUMBER , SIMPLE, LOW REDUNDANCY, BOTTOM
UP
Star Schema Snowflake Schema
Star Schema contains fact tables and Snowflake Schema contains Fact tables ,
dimension tables dimension tables and sub-dimension
tables
Star schema is top down approach Snowflake Schema is bottom up
approach
Star schema is highly denormalized Snowflake schema is normalized
Star Schema is easy to maintain due to Snowflake Schema is difficult to maintain
low redundancy due to high redundancy
Query performance is poor Query performance good
Star schema has fewer joins Snowflake schema has more number of
joins
Star Schema has complex relations like Snowflake Schema has simple relations
1:M like 1:1 / 1:M
Session Outcomes
In this session you learned about:
1. The concept and terminologies of dimensional
modeling
2. Various types of schemas and its implementation
3. The process of dimensional modeling
Thank You

You might also like