DWH Tutorial
DWH Tutorial
Audience
This tutorial will help computer science graduates to understand the basic-toadvanced concepts related to data warehousing.
Prerequisites
Before proceeding with this tutorial, you should have an understanding of basic
database concepts such as schema, ER model, structured query language, etc.
Table of Contents
About the Tutorial ..................................................................................................................................... i
Audience .................................................................................................................................................... i
Prerequisites .............................................................................................................................................. i
Copyright & Disclaimer .............................................................................................................................. i
Table of Contents ...................................................................................................................................... ii
1. OVERVIEW............................................................................................................................. 1
Understanding a Data Warehouse ............................................................................................................ 1
Why a Data Warehouse is Separated from Operational Databases ........................................................... 2
Data Warehouse Features......................................................................................................................... 2
Data Warehouse Applications ................................................................................................................... 3
Types of Data Warehouse ......................................................................................................................... 3
2. CONCEPTS ............................................................................................................................. 5
What is Data Warehousing? ...................................................................................................................... 5
Using Data Warehouse Information .......................................................................................................... 5
Integrating Heterogeneous Databases ...................................................................................................... 5
Functions of Data Warehouse Tools and Utilities ...................................................................................... 6
3. TERMINOLOGIES ................................................................................................................... 8
Metadata .................................................................................................................................................. 8
Metadata Repository ................................................................................................................................ 8
Data Cube ................................................................................................................................................. 9
Data Mart ............................................................................................................................................... 11
Virtual Warehouse .................................................................................................................................. 12
ii
IT Strategy............................................................................................................................................... 14
Business Case .......................................................................................................................................... 14
Education and Prototyping ..................................................................................................................... 14
Business Requirements ........................................................................................................................... 14
Technical Blueprint ................................................................................................................................. 15
Building the Version ................................................................................................................................ 15
History Load ............................................................................................................................................ 15
Ad hoc Query .......................................................................................................................................... 16
Automation ............................................................................................................................................ 16
Extending Scope ...................................................................................................................................... 16
Requirements Evolution ......................................................................................................................... 16
5. SYSTEM PROCESSES............................................................................................................. 18
Process Flow in Data Warehouse ............................................................................................................ 18
Extract and Load Process ........................................................................................................................ 18
Clean and Transform Process .................................................................................................................. 19
Backup and Archive the Data .................................................................................................................. 20
Query Management Process ................................................................................................................... 20
6. ARCHITECTURE .................................................................................................................... 21
Business Analysis Framework ................................................................................................................. 21
Three-Tier Data Warehouse Architecture ............................................................................................... 21
Data Warehouse Models ........................................................................................................................ 22
Load Manager ......................................................................................................................................... 24
Warehouse Manager .............................................................................................................................. 25
Query Manager ....................................................................................................................................... 26
Detailed Information .............................................................................................................................. 27
Summary Information ............................................................................................................................. 28
iii
7. OLAP ................................................................................................................................... 29
Types of OLAP Servers ............................................................................................................................ 29
Relational OLAP ...................................................................................................................................... 29
Multidimensional OLAP .......................................................................................................................... 29
Hybrid OLAP............................................................................................................................................ 29
Specialized SQL Servers ........................................................................................................................... 30
OLAP Operations..................................................................................................................................... 30
OLAP vs OLTP .......................................................................................................................................... 35
9. MULTIDIMENSIONAL OLAP.................................................................................................. 39
MOLAP Architecture ............................................................................................................................... 39
MOLAP vs ROLAP .................................................................................................................................... 40
iv
16. SECURITY............................................................................................................................. 69
Security Requirements ............................................................................................................................ 69
User Access ............................................................................................................................................. 70
Data Movement ...................................................................................................................................... 73
Documentation ....................................................................................................................................... 73
Impact of Security on Design................................................................................................................... 74
vi
1. OVERVIEW
DWH
The term "Data Warehouse" was first coined by Bill Inmon in 1990. According to
Inmon, a data warehouse is a subject-oriented, integrated, time-variant, and
non-volatile collection of data. This data helps analysts to take informed
decisions in an organization.
An operational database undergoes frequent changes on a daily basis on account
of the transactions that take place. Suppose a business executive wants to
analyze previous feedback on any data such as a product, a supplier, or any
consumer data, then the executive will have no data available to analyze
because the previous data has been updated due to transactions.
A data warehouses provides us generalized and consolidated data in
multidimensional view. Along with generalized and consolidated view of data, a
data warehouses also provides us Online Analytical Processing (OLAP) tools.
These tools help us in interactive and effective analysis of data in a
multidimensional space. This analysis results in data generalization and data
mining.
Data mining functions such as association, clustering, classification, prediction
can be integrated with OLAP operations to enhance the interactive mining of
knowledge at multiple level of abstraction. That's why data warehouse has now
become an important platform for data analysis and online analytical processing.
DWH
Note: A data warehouse does not require transaction processing, recovery, and
concurrency controls, because it is physically stored and separate from the
operational database.
2
DWH
Financial services
Banking services
Consumer goods
Retail sectors
Controlled manufacturing
Operational Database(OLTP)
DWH
It is application oriented.
2. CONCEPTS
DWH
Query-driven Approach
Update-driven Approach
Query-Driven Approach
This is the traditional approach to integrate heterogeneous databases. This
approach was used to build wrappers and integrators on top of multiple
heterogeneous databases. These integrators are also known as mediators.
DWH
set.
Disadvantages
Update-Driven Approach
This is an alternative to the traditional approach. Today's data warehouse
systems follow update-driven approach rather than the traditional approach
discussed earlier. In update-driven approach, the information from multiple
heterogeneous sources are integrated in advance and are stored in a warehouse.
This information is available for direct querying and analysis.
Advantages
This approach has the following advantages:
DWH
Note: Data cleaning and data transformation are important steps in improving
the quality of data and data mining results.
3. TERMINOLOGIES
DWH
In this chapter, we will discuss some of the most commonly used terms in data
warehousing.
Metadata
Metadata is simply defined as data about data. The data that are used to
represent other data is known as metadata. For example, the index of a book
serves as a metadata for the contents in the book. In other words, we can say
that metadata is the summarized data that leads us to the detailed data.
In terms of data warehouse, we can define metadata as following:
Metadata Repository
Metadata repository is an integral part of a data warehouse system. It contains
the following metadata:
DWH
Data Cube
A data cube helps us represent data in multiple dimensions. It is defined by
dimensions and facts. The dimensions are the entities with respect to which an
enterprise preserves the records.
But here in this 2-D table, we have records with respect to time and item only.
The sales for New Delhi are shown with respect to time, and item dimensions
according to type of items sold. If we want to view the sales data with one more
dimension, say, the location dimension, then the 3-D view would be useful. The
3-D view of the sales data with respect to time, item, and location is shown in
the table below:
DWH
The above 3-D table can be represented as 3-D data cube as shown in the
following figure:
10
DWH
Data Mart
Data marts contain a subset of organization-wide data that is valuable to specific
groups of people in an organization. In other words, a data mart contains only
those data that is specific to a particular group. For example, the marketing data
mart may contain only data related to items, customers, and sales. Data marts
are confined to subjects.
The life cycle of data marts may be complex in the long run, if their
planning and design are not organization-wide.
11
DWH
Virtual Warehouse
The view over an operational data warehouse is known as virtual warehouse. It
is easy to build a virtual warehouse. Building a virtual warehouse requires
excess capacity on operational database servers.
12
4. DELIVERY PROCESS
DWH
Delivery Method
The delivery method is a variant of the joint application development approach
adopted for the delivery of a data warehouse. We have staged the data
warehouse delivery process to minimize risks. The approach that we will discuss
here does not reduce the overall delivery time-scales but ensures the business
benefits are delivered incrementally through the development process.
Note: The delivery process is broken into phases to reduce the project and
delivery risk.
The following diagram explains the stages in the delivery process:
13
DWH
IT Strategy
Data warehouses are strategic investments that require a business process to
generate benefits. IT Strategy is required to procure and retain funding for the
project.
Business Case
The objective of business case is to estimate business benefits that should be
derived from using a data warehouse. These benefits may not be quantifiable
but the projected benefits need to be clearly stated. If a data warehouse does
not have a clear business case, then the business tends to suffer from credibility
problems at some stage during the delivery process. Therefore in data
warehouse projects, we need to understand the business case for investment.
The prototype can be thrown away after the feasibility concept has been
shown.
The activity addresses a small subset of eventual data content of the data
warehouse.
The following points are to be kept in mind to produce an early release and
deliver business benefits.
Limit the scope of the first build phase to the minimum that delivers
business benefits.
Business Requirements
To provide quality deliverables, we should make sure the overall requirements
are understood. If we understand the business requirements for both short-term
14
DWH
Technical Blueprint
This phase needs to deliver an overall architecture satisfying the long-term
requirements. This phase also delivers the components that must be
implemented on a short-term basis to derive any business benefit. A blueprint
identifies the following:
History Load
This is the phase where the remainder of the required history is loaded into the
data warehouse. In this phase, we do not add any new entities, but additional
physical tables would probably be created to store increased data volumes.
Let us take an example. Suppose the build version phase has delivered a retail
sales analysis data warehouse with 2 months worth of history. This information
will allow the user to analyze only the recent trends and address the short-term
issues. The user in this case cannot identify annual and seasonal trends. To help
him do so, last 2 years sales history could be loaded from the archive. Now the
40GB data is extended to 400GB.
15
DWH
Note: The backup and recovery procedures may become complex, therefore it is
recommended to perform this activity within a separate phase.
Ad hoc Query
In this phase, we configure an ad hoc query tool that is used to operate a data
warehouse. These tools can generate the database query.
Note: It is recommended not to use these access tools when the database is
being substantially modified.
Automation
In this phase, operational management processes are fully automated. These
would include:
Extending Scope
In this phase, the data warehouse is extended to address a new set of business
requirements. The scope can be extended in two ways:
Requirements Evolution
From the perspective of delivery process, the requirements are always
changeable. They are not static. The delivery process must support this and
allow these changes to be reflected within the system.
This issue is addressed by designing the data warehouse around the use of data
within business processes, as opposed to the data requirements of existing
queries.
16
DWH
The architecture is designed to change and grow to match the business needs,
the process operates as a pseudo-application development process, where the
new requirements are continually fed into the development activities and the
partial deliverables are produced. These partial deliverables are fed back to the
users and then reworked ensuring that the overall system is continually updated
to meet the business needs.
17
5. SYSTEM PROCESSES
DWH
DWH
Aggregation
within itself.
DWH
Aggregation
Aggregation is required to speed up common queries. Aggregation relies on the
fact that most common queries will analyze a subset or an aggregation of the
detailed data.
ensures that all the system sources are used in the most effective way.
20
6. ARCHITECTURE
DWH
In this chapter, we will discuss the business analysis framework for the data
warehouse design and architecture of a data warehouse.
The data source view - This view presents the information being
captured, stored, and managed by the operational system.
The data warehouse view - This view includes the fact tables and
dimension tables. It represents the information stored inside the data
warehouse.
The business query view - It is the view of the data from the viewpoint
of the end-user.
Bottom Tier - The bottom tier of the architecture is the data warehouse
database server. It is the relational database system. We use the back21
DWH
end tools and utilities to feed data into the bottom tier. These backend
tools and utilities perform the Extract, Clean, Load, and refresh functions.
Middle Tier - In the middle tier, we have the OLAP Server that can be
implemented in either of the following ways.
o
Top-Tier - This tier is the front-end client layer. This layer holds the
query tools and reporting tools, analysis tools and data mining tools.
Virtual Warehouse
Data mart
22
DWH
Enterprise Warehouse
Virtual Warehouse
The view over an operational data warehouse is known as a virtual warehouse.
It is easy to build a virtual warehouse. Building a virtual warehouse requires
excess capacity on operational database servers.
Data Mart
Data mart contains a subset of organization-wide data. This subset of data is
valuable to specific groups of an organization.
In other words, we can claim that data marts contain data specific to a particular
group. For example, the marketing data mart may contain data related to items,
customers, and sales. Data marts are confined to subjects.
Points to remember about data marts:
The life cycle of a data mart may be complex in long run, if its planning
and design are not organization-wide.
Enterprise Warehouse
23
DWH
Load Manager
This component performs the operations required to extract and load process.
The size and complexity of the load manager varies between specific solutions
from one data warehouse to other.
Fast Load
In order to minimize the total load window the data need to be loaded into
the warehouse in the fastest possible time.
24
DWH
Simple Transformations
While loading it may be required to perform simple transformations. After this
has been completed we are in position to do the complex checks. Suppose we
are loading the EPOS sales transaction we need to perform the following checks:
Strip out all the columns that are not required within the warehouse.
Warehouse Manager
A warehouse manager is responsible for the warehouse management process. It
consists of third-party system software, C programs, and shell scripts.
The size and complexity of warehouse managers varies between specific
solutions.
Backup/Recovery tool
SQL Scripts
25
DWH
Creates indexes, business views, partition views against the base data.
Transforms and merges the source data into the published data
warehouse.
Archives the data that has reached the end of its captured life.
and
updates
existing
aggregations.
Note: A warehouse manager also analyzes query profiles to determine index and
aggregations are appropriate.
Query Manager
Stored procedures
26
DWH
Detailed Information
Detailed information is not kept online, rather it is aggregated to the next level
of detail and then archived to tape. The detailed information part of data
warehouse keeps the detailed information in the starflake schema. Detailed
information is loaded into the data warehouse to supplement the aggregated
data.
The following diagram shows
a pictorial impression of where detailed
information is stored and how it is used.
27
DWH
Summary Information
Summary Information is a part of data warehouse that stores predefined
aggregations. These aggregations are generated by the warehouse manager.
Summary Information must be treated as transient. It changes on-the-go in
order to respond to the changing query profiles.
The points to note about summary information are as follows:
It may not have been backed up, since it can be generated fresh from the
detailed information.
28
7. OLAP
DWH
Relational OLAP
ROLAP servers are placed between relational back-end server and client frontend tools. To store and manage warehouse data, ROLAP uses relational or
extended-relational DBMS.
ROLAP includes the following:
Multidimensional OLAP
MOLAP uses array-based multidimensional storage engines for multidimensional
views of data. With multidimensional data stores, the storage utilization may be
low if the dataset is sparse. Therefore, many MOLAP servers use two levels of
data storage representation to handle dense and sparse datasets.
Hybrid OLAP
Hybrid OLAP is a combination of both ROLAP and MOLAP. It offers higher
scalability of ROLAP and faster computation of MOLAP. HOLAP servers allow to
29
DWH
store large data volumes of detailed information. The aggregations are stored
separately in MOLAP store.
OLAP Operations
Since OLAP servers are based on multidimensional view of data, we will discuss
OLAP operations in multidimensional data.
Here is the list of OLAP operations:
Roll-up
Drill-down
Pivot (rotate)
Roll-up
Roll-up performs aggregation on a data cube in any of the following ways:
By dimension reduction
30
DWH
Initially the concept hierarchy was "street < city < province < country".
When roll-up is performed, one or more dimensions from the data cube
are removed.
Drill-down
Drill-down is the reverse operation of roll-up. It is performed by either of the
following ways:
DWH
Initially the concept hierarchy was "day < month < quarter < year."
It navigates the data from less detailed data to highly detailed data.
Slice
The slice operation selects one particular dimension from a given cube and
provides a new sub-cube. Consider the following diagram that shows how slice
works.
32
DWH
Here Slice is performed for the dimension "time" using the criterion time
= "Q1".
Dice
Dice selects two or more dimensions from a given cube and provides a new subcube. Consider the following diagram that shows the dice operation.
33
DWH
The dice operation on the cube based on the following selection criteria involves
three dimensions.
Pivot
The pivot operation is also known as rotation. It rotates the data axes in view in
order to provide an alternative presentation of data. Consider the following
diagram that shows the pivot operation.
34
DWH
OLAP vs OLTP
Data Warehouse (OLAP)
35
DWH
Schema.
Contains historical data.
Highly flexible.
36
8. RELATIONAL OLAP
DWH
Relational OLAP servers are placed between relational back-end server and client
front-end tools. To store and manage the warehouse data, the relational OLAP
uses relational or extended-relational DBMS.
ROLAP includes the following:
Points to Remember
ROLAP tools store and analyze highly volatile and changeable data.
Database server
ROLAP server
Front-end tool
37
DWH
Advantages
Disadvantages
38
DWH
9. MULTIDIMENSIONAL OLAP
Points to Remember
MOLAP Architecture
MOLAP includes the following components:
Database server
MOLAP server
Front-end tool
39
DWH
Advantages
Helps the users connected to a network who need to analyze larger, lessdefined data.
Disadvantages
MOLAP vs ROLAP
MOLAP
ROLAP
40
10. SCHEMAS
DWH
Schema is a logical description of the entire database. It includes the name and
description of records of all record types including all associated data-items and
aggregates. Much like a database, a data warehouse also requires to maintain a
schema. A database uses relational model, while a data warehouse uses Star,
Snowflake, and Fact Constellation schema. In this chapter, we will discuss the
schemas used in a data warehouse.
Star Schema
The following diagram shows the sales data of a company with respect to
the four dimensions, namely time, item, branch, and location.
There is a fact table at the center. It contains the keys to each of four
dimensions.
The fact table also contains the attributes, namely dollars sold and units
sold.
Note: Each dimension has only one dimension table and each table holds a set
of attributes. For example, the location dimension table contains the attribute
set {location_key, street, city, province_or_state,country}. This constraint may
cause data redundancy. For example, "Vancouver" and "Victoria" both the cities
41
DWH
are in the Canadian province of British Columbia. The entries for such cities may
cause data redundancy along the attributes province_or_state and country.
Snowflake Schema
The supplier key is linked to the supplier dimension table. The supplier
dimension table contains the attributes supplier_key and supplier_type.
The following diagram shows two fact tables, namely sales and shipping.
42
DWH
The shipping fact table has the five dimensions, namely item_key,
time_key, shipper_key, from_location, to_location.
The shipping fact table also contains two measures, namely dollars sold
and units sold.
Schema Definition
Multidimensional schema is defined using Data Mining Query Language (DMQL).
The two primitives, cube definition and dimension definition, can be used for
defining the data warehouses and data marts.
DWH
define dimension time as (time key, day, day of week, month, quarter, year)
define dimension item as (item key, item name, brand, type, supplier type)
define dimension time as (time key, day, day of week, month, quarter, year)
define dimension item as (item key, item name, brand, type, supplier
(supplier key, supplier type))
define dimension branch as (branch key, branch name, branch type)
define dimension location as (location key, street, city
(city key, city, province or state, country))
define dimension time as (time key, day, day of week, month, quarter, year)
define dimension item as (item key, item name, brand, type, supplier type)
DWH
45
DWH
To assist backup/recovery,
To enhance performance.
To Enhance Performance
By partitioning the fact table into sets of data, the query procedures can be
enhanced. Query performance is enhanced because now the query scans only
those partitions that are relevant. It does not have to scan the whole data.
46
DWH
Horizontal Partitioning
There are various ways in which a fact table can be partitioned. In horizontal
partitioning, we have to keep in mind the requirements for manageability of the
data warehouse.
Points to Note
The number of physical tables is kept relatively small, which reduces the
operating cost.
This technique is suitable where a mix of data dipping recent history and
data mining through entire history is required.
47
DWH
Points to Note
The query does not have to scan irrelevant data which speeds up the
query process.
If the dimension changes, then the entire fact table would have to be
repartitioned.
Points to Note
Partitioning Dimensions
If a dimension contains large number of entries, then it is required to partition
the dimension. Here we have to check the size of a dimension.
Consider a large design that changes over time. If we need to store all the
variations in order to apply comparisons, that dimension may be very large. This
would definitely affect the response time.
48
DWH
Vertical Partition
Vertical partitioning splits the data vertically. The following image depicts how
vertical partitioning is done.
Normalization
Row Splitting
Normalization
Normalization is the standard relational method of database organization. In this
method, the rows are collapsed into a single row, hence it reduces space. Take a
look at the following tables that show how normalization is performed.
49
DWH
Qnty
Value
sales_date
Store_id
Store
_name
Location
Region
30
3.67
3-Aug-13
16
sunny
Bangalore
35
5.33
3-Sep-13
16
sunny
Bangalore
40
2.50
3-Sep-13
64
san
Mumbai
45
5.66
3-Sep-13
16
sunny
Bangalore
Store_name
Location
Region
16
sunny
Bangalore
64
san
Mumbai
Product_id
Quantity
Value
sales_date
Store_id
30
3.67
3-Aug-13
16
35
5.33
3-Sep-13
16
40
2.50
3-Sep-13
64
45
5.66
3-Sep-13
16
Row Splitting
Row splitting tends to leave a one-to-one map between partitions. The motive of
row splitting is to speed up the access to a large table by reducing its size.
50
DWH
Note: W hile using vertical partitioning, make sure that there is no requirement
to perform a major join operation between two partitions.
region
transaction_date
51
DWH
What is Metadata?
Metadata is simply defined as data about data. The data that is used to
represent other data is known as metadata. For example, the index of a book
serves as a metadata for the contents in the book. In other words, we can say
that metadata is the summarized data that leads us to detailed data. In terms of
data warehouse, we can define metadata as follows:
Note: In a data warehouse, we create metadata for the data names and
definitions of a given data warehouse. Along with this metadata, additional
metadata is also created for time-stamping any extracted data, the source of
extracted data.
Categories of Metadata
Metadata can be broadly categorized into three categories:
52
DWH
Role of Metadata
Metadata has a very important role in a data warehouse. The role of metadata in
a warehouse is different from the warehouse data, yet it plays an important role.
The various roles of metadata are explained below.
This directory helps the decision support system to locate the contents of
the data warehouse.
Metadata helps in decision support system for mapping of data when data
is transformed from operational environment to data warehouse
environment.
53
DWH
Metadata Respiratory
Metadata respiratory is an integral part of a data warehouse system. It has the
following metadata:
54
DWH
55
DWH
Note: Do not data mart for any other reason since the operation cost of data
marting could be very high. Before data marting, make sure that data marting
strategy is appropriate for your particular solution.
56
DWH
As the merchant is not interested in the products they are not dealing with, the
data marting is a subset of the data dealing which the product group of interest.
The following diagram shows data marting for different users.
Given below are the issues to be taken into account while determining the
functional split:
The merchant could query the sales trend of other products to analyze
what is happening to the sales.
57
DWH
Note: In order to ensure consistency of data across all access tools, the data
should not be directly populated from the data warehouse, rather each tool must
have its own data mart.
58
DWH
The summaries are data marted in the same way as they would have been
designed within the data warehouse. Summary tables help to utilize all
dimension data in the starflake schema.
Network Access
DWH
Network Access
A data mart could be on a different location from the data warehouse, so we
should ensure that the LAN or WAN has the capacity to handle the data volumes
being transferred within the data mart load process.
Network capacity
60
DWH
DWH
Note: The above list can be used as evaluation parameters for the evaluation of
a good scheduler.
Some important jobs that a scheduler must be able to handle are as follows:
Data load
Data processing
Index creation
Backup
Aggregation creation
Data transformation
62
DWH
Events
Events are the actions that are generated by the user or the system itself. It
may be noted that an event is a measurable, observable, occurrence of a
defined action.
Given below is a list of common events that are required to be tracked.
Hardware failure
A process dying
The most important thing about events is that they should be capable of
executing on their own. Event packages define the procedures for the predefined
events. The code associated with each event is known as event handler. This
code is executed whenever an event occurs.
DWH
Scheduling
Database awareness
Backups are taken only to protect against data loss. Following are the important
points to remember:
The backup software will keep some form of database of where and when
the piece of data was backed up.
DWH
Process managers are responsible for maintaining the flow of data both into and
out of the data warehouse. There are three different types of process managers:
Load manager
Warehouse manager
Query manager
65
DWH
Fast Load
In order to minimize the total load window, the data needs to be loaded
into the warehouse in the fastest possible time.
Gateway technology is not suitable, since they are inefficient when large
data volumes are involved.
Simple Transformations
While loading, it may be required to perform simple transformations. After
completing simple transformations, we can do complex checks. Suppose we are
loading the EPOS sales transaction, we need to perform the following checks:
Strip out all the columns that are not required within the warehouse.
Warehouse Manager
The warehouse manager is responsible for the warehouse management process.
It consists of a third-party system software, C programs, and shell scripts. The
size and complexity of a warehouse manager varies between specific solutions.
Backup/Recovery tool
SQL scripts
66
DWH
Creates indexes, business views, partition views against the base data.
Generates normalizations.
Transforms and merges the source data into the temporary store of the
published data warehouse.
Archives the data that has reached the end of its captured life.
Query Manager
The query manager is responsible for directing the queries to suitable tables. By
directing the queries to appropriate tables, it speeds up the query request and
response process. In addition, the query manager is responsible for scheduling
the execution of the queries posted by the user.
67
DWH
Stored procedures
68
16. SECURITY
DWH
Security Requirements
Adding security features affect the performance of the data warehouse,
therefore it is important to determine the security requirements as early as
possible. It is difficult to add security features after the data warehouse has
gone live.
During the design phase of the data warehouse, we should keep in mind what
data sources may be added later and what would be the impact of adding those
data sources. We should consider the following possibilities during the design
phase.
Whether the new data sources will require new security and/or audit
restrictions to be implemented?
Whether the new users added who have restricted access to data that is
already generally available?
This situation arises when the future users and the data sources are not well
known. In such a situation, we need to use the knowledge of business and the
objective of data warehouse to know likely requirements.
The following activities get affected by security measures:
User access
Data load
Data movement
Query generation
69
DWH
User Access
We need to first classify the data and then classify the users on the basis of the
data they can access. In other words, the users are classified according to the
data they can access.
Data Classification
The following two approaches can be used to classify the data:
Data can also be classified according to the job function. This restriction
allows only specific users to view particular data. Here we restrict the
users to view only that part of the data in which they are interested and
are responsible for.
There are some issues in the second approach. To understand, let's have an
example. Suppose you are building the data warehouse for a bank. Consider
that the data being stored in the data warehouse is the transaction data for all
the accounts. The question here is, who is allowed to see the transaction data.
The solution lies in classifying the data according to the function.
User Classification
The following approaches can be used to classify the users:
Users can also be classified according to their role, with people grouped
across departments based on their role.
70
DWH
But if each department accesses different data, then we should design the
security access for each department separately. This can be achieved by
departmental data marts. Since these data marts are separated from the data
warehouse, we can enforce separate security restrictions on each data mart.
This approach is shown in the following figure.
DWH
the departments, then apply security restrictions as per the role of the user. The
role access hierarchy is shown in the following figure.
Audit Requirements
Auditing is a subset of security, a costly activity. Auditing
overheads on the system. To complete an audit in time,
hardware and therefore, it is recommended that wherever
should be switched off. Audit requirements can be categorized
Connections
Disconnections
Data access
Data change
Network Requirements
Network security is as important as other securities. We cannot ignore the
network security requirement. We need to consider the following issues:
Are there restrictions on which network routes the data can take?
72
DWH
Data Movement
There exist potential security implications while moving the data. Suppose we
need to transfer some restricted data as a flat file to be loaded. When the data is
loaded into the data warehouse, the following questions are raised:
If we talk about the backup of these flat files, the following questions are raised:
Some other forms of data movement like query result sets also need to be
considered. The questions raised while creating the temporary table are as
follows:
Documentation
The audit and security requirements need to be properly documented. This will
be treated as a part of justification. This document can contain all the
information gathered from:
Data classification
User classification
Network requirements
73
DWH
Application development
Database design
Testing
Application Development
Security affects the overall application development and it also affects the
design of the important components of the data warehouse such as load
manager, warehouse manager, and query manager. The load manager may
require checking code to filter record and place them in different locations. More
transformation rules may also be required to hide certain data. Also there may
be requirements of extra metadata to handle any extra objects.
To create and maintain extra views, the warehouse manager may require extra
codes to enforce security. Extra checks may have to be coded into the data
warehouse to prevent it from being fooled into moving data into a location
where it should not be available. The query manager requires the changes to
handle any access restrictions. The query manager will need to be aware of all
extra views and aggregations.
Database Design
The database layout is also affected because when security measures are
implemented, there is an increase in the number of views and tables. Adding
security increases the size of the database and hence increases the complexity
of the database design and management. It will also add complexity to the
backup management and recovery plan.
Testing
Testing the data warehouse is a complex and lengthy process. Adding security to
the data warehouse also affects the testing time complexity. It affects the
testing in the following two ways:
It will increase the time required for integration and system testing.
There is added functionality to be tested which will increase the size of the
testing suite.
74
17. BACKUP
DWH
Backup Terminologies
Before proceeding further, you should know some of the backup terminologies
discussed below.
Cold backup - Cold backup is taken while the database is completely shut
down. In multi-instance environment, all the instances should be shut
down.
Hot backup - Hot backup is taken when the database engine is up and
running. The requirements of hot backup varies from RDBMS to RDBMS.
Hardware Backup
It is important to decide which hardware to use for the backup. The speed of
processing the backup and restore depends on the hardware being used, how
the hardware is connected, bandwidth of the network, backup software, and the
speed of server's I/O system. Here we will discuss some of the hardware choices
that are available and their pros and cons. These choices are as follows:
Tape Technology
Disk Backups
Tape Technology
The tape choice can be categorized as follows:
Tape media
75
DWH
Tape stackers
Tape silos
Tape Media
There exists several varieties of tape media. Some tape media standards are
listed in the table below:
Tape Media
Capacity
I/O rates
DLT
40 GB
3 MB/s
3490e
1.6 GB
3 MB/s
8 mm
14 GB
1 MB/s
Scalability
Consider the server is a 48node MPP machine. We do not know the node
to connect the tape drive and we do not know how to spread them over
the server nodes to get the optimal performance with least disruption of
the server and least internal I/O latency.
76
DWH
Tape Stackers
The method of loading multiple tapes into a single tape drive is known as tape
stackers. The stacker dismounts the current tape when it has finished with it and
loads the next tape, hence only one tape is available at a time to be accessed.
The price and the capabilities may vary, but the common ability is that they can
perform unattended backups.
Tape Silos
Tape silos provide large store capacities. Tape silos can store and manage
thousands of tapes. They can integrate multiple tape drives. They have the
software and hardware to label and store the tapes they store. It is very
common for the silo to be connected remotely over a network or a dedicated
link. We should ensure that the bandwidth of the connection is up to the job.
Disk Backups
Methods of disk backups are:
Disk-to-disk backups
Mirror breaking
These methods are used in the OLTP system. These methods minimize the
database downtime and maximize the availability.
Disk-to-Disk Backups
Here backup is taken on the disk rather on the tape. Disk-to-disk backups are
done for the following reasons:
Speed of restore
Backing up the data from disk to disk is much faster than to the tape. However it
is the intermediate step of backup. Later the data is backed up on the tape. The
other advantage of disk-to-disk backups is that it gives you an online copy of the
latest backup.
77
DWH
Mirror Breaking
The idea is to have disks mirrored for resilience during the working day. When
backup is required, one of the mirror sets can be broken out. This technique is a
variant of disk-to-disk backups.
Note: The database may need to be shutdown to guarantee consistency of the
backup.
Optical Jukeboxes
Optical jukeboxes allow the data to be stored near line. This technique allows a
large number of optical disks to be managed in the same way as a tape stacker
or a tape silo. The drawback of this technique is that it has slow write speed
than disks. But the optical media provides long-life and reliability that makes
them a good choice of medium for archiving.
Software Backups
There are software tools available that help in the backup process. These
software tools come as a package. These tools not only take backup, they can
effectively manage and control the backup strategies. There are many software
packages available in the market. Some of them are listed in the following table:
Package Name
Vendor
Networker
Legato
ADSM
IBM
Epoch
Epoch Systems
Omniback II
HP
Alexandria
Sequent
DWH
What tape drive and tape media are supported by the package?
79
18. TUNING
DWH
A data warehouse keeps evolving and it is unpredictable what query the user is
going to post in the future. Therefore it becomes more difficult to tune a data
warehouse system. In this chapter, we will discuss how to tune the different
aspects of a data warehouse such as performance, data load, queries, etc.
It is very difficult to predict what query the user is going to post in the
future.
Performance Assessment
Here is a list of objective measures of performance:
Scan rates
It is of no use trying to tune response time, if they are already better than
those required.
DWH
To hide the complexity of the system from the user, aggregations and
views should be used.
It is also possible that the user can write a query you had not tuned for.
The very common approach is to insert data using the SQL Layer. In this
approach, normal checks and constraints need to be performed. When the
data is inserted into the table, the code will run to check for enough space
to insert the data. If sufficient space is not available, then more space
may have to be allocated to these tables. These checks take time to
perform and are costly to CPU.
The second approach is to bypass all these checks and constraints and
place the data directly into the preformatted blocks. These blocks are later
written to the database. It is faster than the first approach, but it can
work only with whole blocks of data. This can lead to some space
wastage.
The third approach is that while loading the data into the table that
already contains the table, we can maintain indexes.
The fourth approach says that to load the data in tables that already
contain data, drop the indexes & recreate them when the data load is
complete. The choice between the third and the fourth approach depends
on how much data is already loaded and how many indexes need to be
rebuilt.
Integrity Checks
Integrity checking highly affects the performance of the load. Following are the
points to remember:
DWH
Tuning Queries
We have two kinds of queries in a data warehouse:
Fixed queries
Ad hocqueries
Fixed Queries
Fixed queries are well defined. Following are the examples of fixed queries:
Regular reports
Canned queries
Common aggregations
Ad hoc Queries
To understand ad hoc queries, it is important to know the ad hoc users of the
data warehouse. For each user or group of users, you need to know the
following:
DWH
Points to Note
It is important to track the users profiles and identify the queries that are
run on a regular basis.
It is also important that the tuning performed does not affect the
performance.
If these queries are identified, then the database will change and new
indexes can be added for those queries.
83
19. TESTING
DWH
Testing is very important for data warehouse systems to make them work
correctly and efficiently. There are three basic levels of testing performed on a
data warehouse:
Unit testing
Integration testing
System testing
Unit Testing
Each module, i.e., procedure, program, SQL Script, Unix shell is tested.
Integration Testing
System Testing
Since the size of the whole data warehouse is very large, it is usually
possible to perform minimal system testing before the test plan can be
enacted.
84
DWH
Test Schedule
First of all, the test schedule is created in the process of developing the test
plan. In this schedule, we predict the estimated time required for the testing of
the entire data warehouse system.
There are different methodologies available to create a test schedule, but none
of them are perfect because the data warehouse is very complex and large. Also
the data warehouse system is evolving in nature. One may face the following
issues while creating a test schedule:
A simple problem may have a large size of query that can take a day or
more to complete, i.e., the query does not complete in a desired time
scale.
Media failure
Instance failure
85
DWH
Event manager
System manager
Database manager
Configuration manager
Querying in parallel
86
DWH
Scheduling software
Overnight processing
Query performance
Note: The most important point is to test the scalability. Failure to do so will
leave us a system design that does not work when the system grows.
87
DWH
As we have seen that the size of the open database has grown
approximately double its magnitude in the last few years, it shows the
significant value that it contains.
The hardware and software that are available today do not allow to keep a
large amount of data online. For example, a Telco call record requires
10TB of data to be kept online, which is just a size of one months record.
If it requires to keep records of sales, marketing customer, employees,
etc., then the size will be more than 100 TB.
Apart from size planning, it is complex to build and run data warehouse
systems that are ever increasing in size. As the number of users
increases, the size of the data warehouse also increases. These users will
also require to access the system.
Hence the future shape of data warehouse will be very different from what is
being created today.
88
DWH
involves
data
cleaning,
data
integration
and
data
DWH
A: The functions performed by Data warehouse tool and utilities are Data
Extraction, Data Cleaning, Data Transformation, Data Loading and Refreshing.
Q: What do you mean by Data Extraction?
A: Data extraction means gathering data from multiple heterogeneous sources.
Q: Define metadata.
A: Metadata is simply defined as data about data. In other words, we can say
that metadata is the summarized data that leads us to the detailed data.
Q: What does Metadata Respiratory contain?
A: Metadata respiratory contains definition of data warehouse, business
metadata, operational metadata, data for mapping from operational
environment to data warehouse, and the algorithms for summarization.
Q: How does a Data Cube help?
A: Data cube helps us to represent the data in multiple dimensions. The data
cube is defined by dimensions and facts.
Q: Define dimension.
A: The dimensions are the entities with respect to which an enterprise keeps the
records.
Q: Explain data mart.
A: Data mart contains the subset of organization-wide data. This subset of data
is valuable to specific groups of an organization. In other words, we can say that
a data mart contains data specific to a particular group.
Q: What is Virtual Warehouse?
A: The view over an operational data warehouse is known as virtual warehouse.
Q: List the phases involved in the data warehouse delivery process.
A: The stages are IT strategy, Education, Business Case Analysis, technical
Blueprint, Build the version, History Load, Ad hoc query, Requirement Evolution,
Automation, and Extending Scope.
Q: Define a load manager.
A: A load manager performs the operations required to extract and load the
process. The size and complexity of load manager varies between specific
solutions from data warehouse to data warehouse.
Q: Define the functions of a load manager.
A: A load manager extracts data from the source system. Fast load the extracted
data into temporary data store. Perform simple transformations into structure
similar to the one in the data warehouse.
90
DWH
OLAP,
DWH
92