Introduction to Data Warehousing
What a data warehouse is (Inmon's 4 keywords), OLTP vs OLAP, why keep it separate, and the multidimensional data model — cubes, facts, dimensions and the lattice of cuboids.
▶Lecture videos
Click any timestamp — here or inside the notes — to jump the video to that moment. Your position is remembered.
Introduction to Data Warehousing
Lecture overview of data warehouses and the multidimensional model.
00:01The need for data warehouses00:51Heterogeneous sources: scientific, health, transactional data01:37Integrating multiple sources into one store03:14The metadata repository04:03Definition: subject-oriented, integrated, time-variant, non-volatile05:22Integrated: sources, cleaning, consistency06:03Time-variant: long time horizon07:12Non-volatile: no transaction processing, recovery or concurrency controlData Mining with Weka 1.1 – Introduction
Ian Witten's introduction to the Weka course and the Weka workbench.
00:18Welcome to Data Mining with Weka01:03We're overwhelmed with data: credit cards, coupons02:37Applications: e.g. IVF embryo selection04:04What Weka is04:55Course structure: classes and lessons05:41Using Weka on your own data1Why data warehouses matter
- Data warehouses generalise and consolidate data in multidimensional space.
- Building one involves data cleaning, data integration and data transformation, so it is an important preprocessing step for data mining.
- They provide OLAP (On-Line Analytical Processing) tools for interactive analysis of multidimensional data at different granularities.
- Mining functions such as association, classification, prediction and clustering can be integrated with OLAP to mine at multiple levels of abstraction.
So the data warehouse is an important platform for data analysis, OLAP and data mining.
2What is a data warehouse?
Data warehousing provides architectures and tools for business executives to systematically organise, understand and use their data to make strategic decisions. Many firms have spent millions building enterprise-wide data warehouses.
- A data warehouse is a database maintained separately from the organisation's operational databases.
- It allows integration of a variety of application systems.
According to William H. Inmon: "A data warehouse is a subject-oriented, integrated, time-variant, and nonvolatile collection of data in support of management's decision-making process."
These four keywords are what set a data warehouse apart from relational DBs, transaction processing systems and file systems:
| Keyword | Meaning | Example |
|---|---|---|
| Subject-oriented | Organised around major subjects (customer, supplier, product, sales). Focuses on modelling and analysis for decision makers, not day-to-day operations | A "Sales" subject area rather than an "invoice entry" app |
| Integrated | Built from multiple heterogeneous sources (relational DBs, flat files, online transaction records). Cleaning and integration ensure consistent naming, encoding, attribute measures | Gender stored as M/F everywhere, not M/F in one source and 1/0 in another |
| Time-variant | Stores data from a historical perspective (past 5–10 years). Every key structure contains an element of time, implicitly or explicitly | Sales per month for the last 8 years |
| Nonvolatile | A physically separate store. It doesn't need transaction processing, recovery or concurrency control. Data is loaded and read, not updated row by row | Nightly load, then read-only queries |
Subject · Integrated · Time-variant · Nonvolatile. Say: "Sales In Time, Never changed."
3OLTP vs OLAP
| OLTP (operational DB) | OLAP (data warehouse) | |
|---|---|---|
| Users | Clerk, IT professional | Knowledge worker (analysts, managers) |
| Function | Day-to-day operations | Decision support |
| DB design | Application-oriented | Subject-oriented |
| Data | Current, up-to-date, detailed, flat relational, isolated | Historical, summarised, multidimensional, integrated, consolidated |
| Usage | Repetitive | Ad-hoc |
| Access | Read/write, index/hash on primary key | Lots of scans (mostly read) |
| Unit of work | Short, simple transaction | Complex query |
| Records accessed | Tens | Millions |
| Number of users | Thousands | Hundreds |
| DB size | 100 MB – GB | 100 GB – TB |
| Metric | Transaction throughput | Query throughput, response time |
- OLTP systems handle online transaction and query processing: purchasing, inventory, manufacturing, banking, payroll, registration, accounting.
- OLAP systems serve knowledge workers doing data analysis and decision making, presenting data in various formats for diverse users.
"Compare OLTP and OLAP" is very likely. Draw this table with at least 6 rows. Users, function, data, access, unit of work and metric are the most important.
4Why keep the warehouse separate?
Why not just run analysis queries on the operational database? Three reasons:
1. Performance of both systems - The operational DB is tuned for known tasks: indexing and hashing on primary keys, finding particular records. - Warehouse queries are complex. They compute large groups at summarised levels and need multidimensional organisation. - Running OLAP queries on the operational DB would substantially degrade operational performance.
2. Concurrency control and recovery - The operational DB processes many concurrent transactions and needs locking and logging. - OLAP queries need only read-only access for summarisation. - Applying concurrency and recovery mechanisms to OLAP would jeopardise concurrent transactions and reduce OLTP throughput.
3. Different data - Decision support needs historical data, which operational DBs usually don't keep. - Operational DBs hold detailed raw data that must be consolidated (aggregated, summarised) before analysis. - Data from different sources must be integrated.
Operational RDBMS vendors are starting to optimise their systems for OLAP queries, so the separation between OLTP and OLAP is expected to decrease.
5The multidimensional data model
Data warehouses and OLAP tools use a multidimensional data model, which views data as a data cube. A cube is defined by dimensions and facts.
Dimensions
The perspectives or entities the organisation wants to keep records about.
Sales example: time, item, branch, location.
Each dimension can have a dimension table describing it. For example, item has item_name, brand and type.
Facts
Numerical measures: the quantities we analyse across dimensions.
Sales example: dollars_sold, units_sold, amount_budgeted.
The fact table holds the measures plus keys to each dimension table. The model is organised around a subject (e.g. sales) represented by the fact table.
2-D cube (Table 5-2)
Sales in Vancouver by time (quarter) × item type. Measure = dollars_sold (in thousands).
| time \ item | home entertainment | computer | phone | security |
|---|---|---|---|---|
| Q1 | 605 | 825 | 14 | 400 |
| Q2 | 680 | 952 | 31 | 512 |
| Q3 | 812 | 1023 | 30 | 501 |
| Q4 | 927 | 1038 | 38 | 580 |
3-D, 4-D … n-D
- Add location (Chicago, New York, Toronto, Vancouver) and the 2-D table becomes a 3-D cube: a stack of 2-D tables, one per city (Table 5-3, Figure 5-1).
- Add supplier and you get a 4-D cube. It can be drawn as a series of 3-D cubes, one per supplier (Figure 5-2).
Data cubes are n-dimensional. "Cube" doesn't mean only 3-D. Also, physical storage may differ from the logical cube view.
6Lattice of cuboids
Given a set of dimensions, we can make a cuboid for every possible subset of them. Each cuboid is a different level of summarisation. Together they form the lattice of cuboids, which is called a data cube.
| Term | Meaning | 4-D example |
|---|---|---|
| Base cuboid | Lowest level of summarisation: all n dimensions | {time, item, location, supplier} |
| Apex cuboid | Highest summarisation: 0-D, everything summed into one value, written all | Total dollars_sold over everything |
| Non-base cuboid | Anything in between | {time, item, location}: 3-D, summarised over all suppliers |
Pick which dimensions to keep. The rest are summed away (rolled up). You're picking one cuboid from the lattice. Fact = dollars_sold (thousands).
Dimensions {time, item, location, supplier}:
- 0-D: 1 (apex)
- 1-D: 4
- 2-D: 6
- 3-D: 4
- 4-D: 1 (base)
Total = 1 + 4 + 6 + 4 + 1 = 16 = 24
OLAP operations (preview)
The lesson introduction names the OLAP operations used on cubes:
| Operation | Effect |
|---|---|
| Roll-up | Summarise: climb a concept hierarchy (city → country) or remove a dimension. In the explorer above, unticking a dimension is a roll-up. |
| Drill-down | Reverse of roll-up: go to more detail (quarter → month) or add a dimension |
| Slice | Select on one dimension, e.g. time = Q1, giving a sub-cube |
| Dice | Select on two or more dimensions, e.g. time ∈ {Q1, Q2} and location ∈ {Toronto, Vancouver} |
7Weka — the tool used in this course
The second video is the first lesson of "Data Mining with Weka" (University of Waikato). From Week 6 onwards you'll use Weka's Explorer to load datasets, apply filters, build classifiers and visualise data.
- Weka is a free, open-source data mining workbench written in Java, from the University of Waikato, New Zealand.
- The course focuses on using mining tools (the Explorer interface) rather than programming.
8Quick revision sheet
| Concept | Remember it as |
|---|---|
| Data warehouse | Separate DB for decision making; built with cleaning, integration, transformation |
| Inmon | Subject-oriented, Integrated, Time-variant, Nonvolatile; supports management decisions |
| Time-variant | 5–10 years of history; every key has a time element |
| Nonvolatile | Physically separate, no transaction processing / recovery / concurrency |
| OLTP | Clerks, day-to-day, current, read/write, short transactions, thousands of users, MB–GB |
| OLAP | Knowledge workers, decision support, historical, scans, complex queries, hundreds of users, GB–TB |
| Why separate | Performance · concurrency/recovery · different data (historical, consolidated) |
| Cube | Dimensions (perspectives) + facts (numeric measures) |
| Fact table | Measures + keys to dimension tables |
| Lattice | 2n cuboids; base = all dims (lowest summary); apex = "all" (highest) |
| OLAP ops | Roll-up, drill-down, slice, dice |
?Self-check quiz
10 questions on this week. Answer them all, then press Check my answers. Your best and latest scores are saved and shown on the subject page.