You are on page 1of 46

Data Warehousing and OLAP Technology

 What is a data warehouse?

 A multi-dimensional data model

 Data warehouse implementation

February 19, 2024 Moso J : Dedan Kimathi University 1


What is a Data Warehouse?
 Defined in many different ways, but not rigorously.
 A decision support database that is maintained separately from the
organization’s operational database
 Support information processing by providing a solid platform of consolidated,
historical data for analysis.
 “A data warehouse is a subject-oriented, integrated, time-variant, and
nonvolatile collection of data in support of management’s decision-making
process.”—W. H. Inmon
 Data warehousing:
 The process of constructing and using data warehouses
February 19, 2024 Moso J : Dedan Kimathi University 2
Data Warehouse—Subject-Oriented

 Organized around major subjects, such as customer,


product, sales
 Focusing on the modeling and analysis of data for decision
makers, not on daily operations or transaction processing
 Provide a simple and concise view around particular subject
issues by excluding data that are not useful in the decision
support process

February 19, 2024 Moso J : Dedan Kimathi University 3


Data Warehouse—Integrated

 Constructed by integrating multiple, heterogeneous


data sources
 relational databases, flat files, on-line transaction records
 Data cleaning and data integration techniques are
applied.
 Ensure consistency in naming conventions, encoding
structures, attribute measures, etc. among different data
sources
 E.g., Hotel price: currency, tax, breakfast covered, etc.

 When data is moved to the warehouse, it is converted.

February 19, 2024 Moso J : Dedan Kimathi University 4


Data Warehouse—Time Variant

 The time horizon for the data warehouse is significantly


longer than that of operational systems
 Operational database: current value data
 Data warehouse data: provide information from a historical
perspective (e.g., past 5-10 years)
 Every key structure in the data warehouse
 Contains an element of time, explicitly or implicitly
 But the key of operational data may or may not contain “time
element”

February 19, 2024 Moso J : Dedan Kimathi University 5


Data Warehouse—Nonvolatile

 A physically separate store of data transformed from the


operational environment
 Operational update of data does not occur in the data
warehouse environment
 Does not require transaction processing, recovery, and
concurrency control mechanisms
 Requires only two operations in data accessing:
 initial loading of data and access of data

February 19, 2024 Moso J : Dedan Kimathi University 6


Data Warehouse vs. Heterogeneous DBMS
 Traditional heterogeneous DB integration: A query driven approach
 Build wrappers/mediators on top of heterogeneous databases
 When a query is posed to a client site, a meta-dictionary is used to translate
the query into queries appropriate for individual heterogeneous sites
involved, and the results are integrated into a global answer set
 Complex information filtering, compete for resources

 Data warehouse: update-driven, high performance


 Information from heterogeneous sources is integrated in advance and stored
in warehouses for direct query and analysis
February 19, 2024 Moso J : Dedan Kimathi University 7
Data Warehouse vs. Operational DBMS
 OLTP (on-line transaction processing)
 Major task of traditional relational DBMS
 Day-to-day operations: purchasing, inventory, banking,
manufacturing, payroll, registration, accounting, etc.

 OLAP (on-line analytical processing)


 Major task of data warehouse system
 Data analysis and decision making

February 19, 2024 Moso J : Dedan Kimathi University 8


OLTP vs. OLAP
OLTP OLAP
users clerk, IT professional knowledge worker
function day to day operations decision support
DB design application-oriented subject-oriented
data current, up-to-date historical,
detailed, flat relational summarized, multidimensional
isolated integrated, consolidated
usage repetitive ad-hoc
access read/write lots of scans
index/hash on prim. key
unit of work short, simple transaction complex query
# records accessed tens millions
#users thousands hundreds
DB size 100MB-GB 100GB-TB
metric transaction throughput query throughput, response

February 19, 2024 Moso J : Dedan Kimathi University 9


Why Separate Data Warehouse?
 High performance for both systems
 DBMS— tuned for OLTP: access methods, indexing, concurrency control,
recovery
 Warehouse—tuned for OLAP: complex OLAP queries, multidimensional view,
consolidation
 Different functions and different data:
 missing data: Decision support (DS) requires historical data which
operational DBs do not typically maintain
 data consolidation: DS requires consolidation (aggregation, summarization)
of data from heterogeneous sources
 data quality: different sources typically use inconsistent data
representations, codes and formats which have to be reconciled

February 19, 2024 Moso J : Dedan Kimathi University 10


Multidimensional data model
 A data warehouse is based on a multidimensional data model which
views data in the form of a data cube
 A data cube, such as sales, allows data to be modeled and viewed in
multiple dimensions
 Dimension tables, such as item (item_name, brand, type) or time(day, week,
month, quarter, year)
 Fact table contains measures (such as shillings_sold) and keys to each of the
related dimension table.
 A n-D base cube is called a base cuboid. The top most 0-D cuboid, which
holds the highest-level of summarization, is called the apex cuboid.

February 19, 2024 Moso J : Dedan Kimathi University 11


Multidimensional Data

 Sales volume as a function of product, month, and region


Dimensions: Product, Location, Time
n

Hierarchical summarization paths


o
gi
Re

Industry Region Year

Category Country Quarter


Product

Product City Month Week

Office Day

Month
February 19, 2024 Moso J : Dedan Kimathi University 12
A Sample Data Cube

Date Total annual sales


1Qtr 2Qtr 3Qtr 4Qtr sum of TV in Kenya
ct
TV
du

PC Kenya
o
Pr

VCR

Country
sum
India

U.K

sum

February 19, 2024 Moso J : Dedan Kimathi University 13


Cuboids Corresponding to the Cube

All 0-D(apex) cuboid

1-D cuboids
product date country

product, date product, country date, country 2-D cuboids

product, date, country 3-D(base) cuboid

February 19, 2024 Moso J : Dedan Kimathi University 14


Multidimensional modeling: Schema Design

 Database organization
 must look like business

 must be recognizable by business user

 approachable by business user

 Must be simple

 Schema Types
 Star Schema

 Fact Constellation Schema

 Snowflake schema

February 19, 2024 Moso J : Dedan Kimathi University 15


Dimension Tables

 Dimension tables
 Define business in terms already familiar to users

 Wide rows with lots of descriptive text

 Small tables (about a million rows)

 Joined to fact table by a foreign key

 heavily indexed

 typical dimensions

 time periods, geographic region (markets, cities),


products, customers, salesperson, etc.

February 19, 2024 Moso J : Dedan Kimathi University 16


Fact Table

 Central table
 mostly raw numeric items

 narrow rows, a few columns at most

 large number of rows (millions to a billion)

 Access via dimensions

February 19, 2024 Moso J : Dedan Kimathi University 17


Conceptual Modeling of Data Warehouses

 Star schema: A single fact table in the middle and for each dimension
one dimension table.
Does not capture hierarchies directly
 Snowflake schema: A refinement of star schema where some
dimensional hierarchy is normalized into a set of smaller dimension
tables, forming a shape similar to snowflake.
Easy to maintain and saves storage
 Fact constellations: Multiple fact tables share dimension tables, viewed
as a collection of stars, therefore called galaxy schema or fact
constellation
February 19, 2024 Moso J : Dedan Kimathi University 18
Example of Star Schema

time
time_key item
day item_key
day_of_the_week Sales Fact Table item_name
month brand
quarter time_key type
year item_key supplier_type
branch_key
branch location_key location
branch_key location_key
units_sold
branch_name street
branch_type dollars_sold city
state_or_province
avg_sales
country
Measures
February 19, 2024 Moso J : Dedan Kimathi University 19
Example of Snowflake Schema

time
time_key item
day item_key
day_of_the_week
supplier
Sales Fact Table item_name supplier_key
month brand
time_key supplier_type
quarter type
year item_key supplier_type
branch_key
branch location_key location
branch_key location_key
units_sold
branch_name street
dollars_sold city city
branch_type
city_key
avg_sales city
state_or_province
Measures country

February 19, 2024 Moso J : Dedan Kimathi University 20


Example of Fact Constellation

time Shipping Fact Table


time_key item
day time_key
day_of_the_week item_key
Sales Fact Table item_key
month item_name
brand shipper_key
quarter time_key
year type from_location
item_key supplier_type
to_location
branch_key
dollars_cost
branch location_key location
units_shipped
branch_key units_sold location_key
branch_name street
branch_type dollars_sold shipper
city
avg_sales province_or_state shipper_key
country shipper_name
Measures location_key
shipper_type
February 19, 2024 Moso J : Dedan Kimathi University 21
Data warehouse Architecture

 Architecture properties that are essential for a data warehouse


system
 Separation: Analytical and transactional processing should be kept apart as
much as possible.
 Scalability: Hardware and software architectures should be easy to upgrade as
the data volume, which has to be managed and processed, and the number of
users’ requirements, which have to be met, progressively increase.
 Extensibility: The architecture should be able to host new applications and
technologies without redesigning the whole system.
 Security: Monitoring accesses is essential because of the strategic data stored
in data warehouses.
 Administerability: Data warehouse management should not be overly difficult.

February 19, 2024 Moso J : Dedan Kimathi University 22


Architecture Classification

 Data and control


Based on how the different layers are employed to create
enterprise-oriented or department-oriented views of data
warehouses.

 Structure-oriented
Depends on the number of layers used by the architecture

February 19, 2024 Moso J : Dedan Kimathi University 23


Global architecture

 Support all, or a large part of the corporation


 High degree of data access and usage(global) across departments
or lines-of-business
 Designed and constructed based on the needs of the enterprise as a
whole
 Physically centralized or
 Physically distributed throughout the organization
 Managed by IS( note not controlled)
 Enables end users to have more of an enterprise-wide or corporate-
wide view of the data

February 19, 2024 Moso J : Dedan Kimathi University 24


Global architecture

February 19, 2024 Moso J : Dedan Kimathi University 25


Independent data mart architecture

 Stand-alone data marts


 Controlled by a particular workgroup, department, or line
of business
 Built solely to meet their needs
 Have minimal impact on IS resources and can result in a
very fast implementation

February 19, 2024 Moso J : Dedan Kimathi University 26


Independent data mart architecture

February 19, 2024 Moso J : Dedan Kimathi University 27


Single Layer Architecture

 Its goal is to minimize the amount of data stored


 It removes data redundancies
 Source layer is the only one physically available
 Data ware houses are virtual
Implemented as a multidimensional view of operational
data created by specific middleware, or an intermediate
processing layer
 Weakness: does not separate transactional and
analytical processing

February 19, 2024 Moso J : Dedan Kimathi University 28


Single Layer Architecture

February 19, 2024 Moso J : Dedan Kimathi University 29


Two Layer Architecture

 Separation between physically available sources and


data warehouses
 consists of four subsequent data flow stages
 Source layer
 Data staging
 Data warehouse layer
 Analysis

February 19, 2024 Moso J : Dedan Kimathi University 30


Two Layer Architecture

 Data marts are used


 They are important because
 They are used as building blocks while incrementally
developing data warehouses;
 They mark out the information required by a specific
group of users to solve queries;
 They can deliver better performance because they are
smaller than primary data warehouses

February 19, 2024 Moso J : Dedan Kimathi University 31


Two Layer Architecture

Source layer
Operational Data External Data

ETL Tools Data staging

Data Warehouse Data


warehouse
Meta Data layer
Data Marts

Reporting tools What-if analysis Analysis


tools
OLAP tools Data mining tools
February 19, 2024 Moso J : Dedan Kimathi University 32
Three Layer Architecture

 Reconciled data layer is added


 Materializes operational data obtained after integrating
and cleansing source data
 Hence the data are integrated, consistent, correct,
current, and detailed.
 Sometimes used to create daily report

February 19, 2024 Moso J : Dedan Kimathi University 33


Three Layer Architecture

Source layer
Operational Data External Data

ETL Tools Data staging


Reconciled Data
Reconciled layer
ETL Tools Meta Data
loading
Data Warehouse
Data
Data Marts warehouse
layer

Reporting tools What-if analysis Analysis


tools
OLAP tools Data mining tools
February 19, 2024 Moso J : Dedan Kimathi University 34
Design of Data Warehouse: A Business
Analysis Framework
 Four views regarding the design of a data warehouse
 Top-down view
 allows selection of the relevant information necessary for the data
warehouse
 Data source view
 exposes the information being captured, stored, and managed by
operational systems
 Data warehouse view
 consists of fact tables and dimension tables
 Business query view
 sees the perspectives of data in the warehouse from the view of end-user

February 19, 2024 Moso J : Dedan Kimathi University 35


Data Warehouse Design Process
 Top-down, bottom-up approaches or a combination of both
 Top-down: Starts with overall design and planning (mature)
 Bottom-up: Starts with experiments and prototypes (rapid)
 From software engineering point of view
 Waterfall: structured and systematic analysis at each step before proceeding to
the next
 Spiral: rapid generation of increasingly functional systems, short turn around
time, quick turn around
 Typical data warehouse design process
 Choose a business process to model, e.g., orders, invoices, etc.
 Choose the grain (atomic level of data) of the business process
 Choose the dimensions that will apply to each fact table record
 Choose the measure that will populate each fact table record
February 19, 2024 Moso J : Dedan Kimathi University 36
Data Warehouse Models

 Enterprise warehouse
 collects all of the information about subjects spanning the entire

organization
 Data Mart
 a subset of corporate-wide data that is of value to a specific

groups of users. Its scope is confined to specific, selected


groups, such as marketing data mart
 Independent vs. dependent (directly from warehouse) data mart
 Virtual warehouse
 A set of views over operational databases

 Only some of the possible summary views may be materialized

February 19, 2024 Moso J : Dedan Kimathi University 37


Data Warehouse Back-End Tools and Utilities

 Data extraction
 get data from multiple, heterogeneous, and external sources

 Data cleaning
 detect errors in the data and rectify them when possible

 Data transformation
 convert data from legacy or host format to warehouse format

 Load
 sort, summarize, consolidate, compute views, check integrity,

and build indicies and partitions


 Refresh
 propagate the updates from the data sources to the warehouse

February 19, 2024 Moso J : Dedan Kimathi University 38


Metadata Repository

 Meta data is the data defining warehouse objects. It stores:


 Description of the structure of the data warehouse
 schema, view, dimensions, hierarchies, derived data definitions, data mart locations
and contents
 Operational meta-data
 data lineage (history of migrated data and transformation path), currency of data
(active, archived, or purged), monitoring information (warehouse usage statistics,
error reports, audit trails)
 The algorithms used for summarization
 The mapping from operational environment to the data warehouse
 Data related to system performance
 warehouse schema, view and derived data definitions

 Business data: business terms and definitions, ownership of data, charging policies

February 19, 2024 Moso J : Dedan Kimathi University 39


OLAP Server Architectures

 Relational OLAP (ROLAP)


 Use relational or extended-relational DBMS to store and manage warehouse data
and OLAP middle ware
 Include optimization of DBMS backend, implementation of aggregation navigation
logic, and additional tools and services
 Greater scalability
 Multidimensional OLAP (MOLAP)
 Sparse array-based multidimensional storage engine
 Fast indexing to pre-computed summarized data
 Hybrid OLAP (HOLAP) (e.g., Microsoft SQLServer)
 Flexibility, e.g., low level: relational, high-level: array
 Specialized SQL servers (e.g., Redbricks)
 Specialized support for SQL queries over star/snowflake schemas
February 19, 2024 Moso J : Dedan Kimathi University 40
Typical OLAP Operations

 Roll up (drill-up): summarize data


 by climbing up hierarchy or by dimension reduction
 Drill down (roll down): reverse of roll-up
 from higher level summary to lower level summary or detailed data, or introducing
new dimensions
 Slice and dice:
 project and select
 Pivot (rotate):
 reorient the cube, visualization, 3D to series of 2D planes.
 Other operations
 drill across: involving (across) more than one fact table
 drill through: through the bottom level of the cube to its back-end relational tables
(using SQL)
February 19, 2024 Moso J : Dedan Kimathi University 41
A Visual Operation: Pivot (Rotate)

NY
LA nth
Mo
SF

10
Juice
47

Region
Cola
Milk 30
Cream 12 Product

3/1 3/2 3/3 3/4

Date
42
“Slicing and Dicing”

The Telecomm Slice


Product

Household

Telecomm n s
gio
e
R Europe
Video
Far East
Audio India

Retail Direct Special Sales Channel

43
Roll-up and Drill Down
Higher Level of
Aggregation

 Sales Channel
Region

Drill-Down

 Country
Roll Up

 State
 Location Address
 Sales Representative
Low-level
Details
44
Data Warehouse Usage

 Three kinds of data warehouse applications


 Information processing
 supports querying, basic statistical analysis, and reporting using crosstabs,
tables, charts and graphs
 Analytical processing
 multidimensional analysis of data warehouse data
 supports basic OLAP operations, slice-dice, drilling, pivoting
 Data mining
 knowledge discovery from hidden patterns
 supports associations, constructing analytical models, performing classification
and prediction, and presenting the mining results using visualization tools

February 19, 2024 Moso J : Dedan Kimathi University 45


Properties characterizing data quality

 Accuracy - Stored values should be compliant with real-world ones.


 Freshness - Data should not be old.
 Completeness - There should be no lack of information.
 Consistency - Data representation should be uniform.
 Availability - Users should have easy access to data.
 Traceability - Data can easily be traced back to its sources.
 Clearness - Data can be easily understood.

February 19, 2024 Moso J : Dedan Kimathi University 46

You might also like