Thursday, 6 March 2014

Data warehousing - Architecture, Fact & Dimension tables

***********************************************************************
Data warehousing

A data warehousing is a subject-oriented, integrated, time-variant and non-volatile collection of data in support of management decision making process. This is the standard definition of data warehouse came from Bill Inmon (Father of Data warehouse). Below is the description of definition:

Subject-oriented: Data warehouse is designed to to help you to analyze the data.For Example "Sales" can be a particular subject. This ability to define a data warehouse by subject matter, sales in this case, makes the data warehouse subject oriented.

Integrated: A data warehouse integrates/combine the data form multiple sources. For example source A and source B may have different ways of identifying the products but in DW there will be single way of identifying the product.

Time-variant: The historical data is kept in data warehouse. For example one can get the data of 3 months, 9 months or even older data from data warehouse. This is totally opposite in transactions system in which only most recent data is kept. example to understand is, transactions system may hold most recent address of customer where data warehouse can hold all addresses associated with a customer.

Non-volatile: Once data is entered into data warehouse, it will not change. So, historical data in data warehouse can not be altered. This is because purpose of data warehouse is to enable you to analyze what has occurred.


Data Warehouse Architecture

Different data warehouse systems have different structures. In general all data warehouse systems have following layers:
1. Data source layer
2. Data extraction layer
3. Staging area
4. ETL layer
5. Data storage layer
6. Data logic layer
7. Data presentation layer
8. Metadata layer
9. System operations layer


We will discuss each layer as below:
1. Data source layer:
    This indicates that data source that feed data into data warehouse. Data source can be of any format - flat file, relational database, Excel file. All these data sources together form data source layer. Data comes form different types of sources to this layer.

2. Data extraction layer:
    Data is extracted from data source into data warehouse system. There is likely some minimal cleansing happens; but not any major data transformation happens.

3. Staging area:
    This is the place where data sits prior to being scrubbed and transformed into data warehouse/data mart.

4. ETL layer:
    Data gets transformed in this layer. Logic will get applied in this layer to transform the data from transnational nature to analytic nature. In this layer also some data cleansing happens.

5. Data storage layer:
    This is the layer where transformed data and cleansed data sits. Depending on scope and functionality, three types of entities can be found here as data warehouse, data mart and operation data store (ODS).

6. Data logic layer:
    This is where business logic rules stores. Business rules stored in this layer doesn't affect the underlying data transformation rules, but does affect what the report looks like,

7. Data presentation layer:
    This refers to information that reaches the users. This can be in tabular form/ graphical form in browser. Usually OLAP tool and/or Reporting tool is used in this layer.

8. Metadata layer:
    This is where information about data stored in data warehouse is stored. A metadata tool is often used to manage metadata.

9. System operations layer:
    This layer includes information about how data warehouse system operates, such as ETL job status, system performance and user access history.


Dimension & Fact tables

Dimension table:
                   Dimension tables are used to describe the dimensions. Now here dimension means category of information, mainly contains descriptive text. Example Time dimension.
Dimension table contains dimension keys, values and attributes

For example Time dimension would contains each hour, day, week, month, quarter and year.
Dimension tables are typically small, ranging from few to several thousand records. Occasionally, these tables can grow fairly large.
Below is Customer dimension table look like:
Customer_key
Customer_full_name
Customer_city
Customer_state
Customer_country

Attributes: It is nothing but unique level within dimension. For example Month is attribute in Time dimension.

Hierarchy: Specific level that represents relationship between different attributes in dimension tables. For example in Time dimension: Year > Quarter > Month > Day.


Fact table: 
                   Fact table is table that contains measures of interest. Foe example sales amount wold be such a measure. This measure is stored in fact table with appropriate granularity. In this case, fact table would contains three columns such as date, store, sales amount columns.

                   Fact tables contains primary keys of dimension tables as foreign key as well as measurable facts that data analysts would want to examine. Fact tables can grow very large with millions or billions of rows.

Types of Facts:

There are three types of facts.
1. Additive: Additive facts are facts that can be summed up through all of the dimensions in the      fact table.

2. Semi-Additive: Semi-Additive facts are facts that can be summed up for some of the                   dimensions in the fact tables , but not the others.

3. Non-AdditiveSemi-Additive facts are facts that can not be summed up for any of the                   dimensions present in fact table.

Types of Fact Tables:
                  Based on above classifications, there are two types of fact tables:

1. Cumulative
     This type of fact tables described what has happened over the period of time. For example this fact table may describe the total sales by product by store by day. The facts of this type of fact tables are mostly additive facts.

2. Snapshot
      This type of fact table describes the state of things in particular instance of time and usually includes more semi additive and non-additive facts.



*********************************************************************************

2 comments:

  1. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving.. very specific nice content. And tell people specific ways to live their lives.Sometimes you just have to yell at people and give them a good shake to get your point across.

    Hadoop Training in Chennai

    Base SAS Training in Chennai

    MSBI Training in Chennai

    ReplyDelete
  2. Nice post ! Thanks for sharing valuable information with us. Keep sharing.. Informatica Online Training Bangalore

    ReplyDelete