Chapter 4
Data Warehousing, OLAP and Mining Architecture
Bachelors Program in Computer Science Engineering
Data Mining
•
Bachelor
Data Warehousing, OLAP and Mining Architecture
Introduction and Context
Data mining rarely operates directly on isolated operational tables. Enterprise data is distributed across transaction-processing systems, customer applications, enterprise resource planning systems, web platforms, sensors, spreadsheets, and external data services. These sources differ in structure, quality, update frequency, naming conventions, and business meaning. Before patterns can be discovered, data must be integrated, organized, documented, and made accessible for analysis.
A data warehouse provides a governed analytical foundation for this purpose. It stores integrated, historical, and subject-oriented data. Online analytical processing (OLAP) provides structures and operations for examining that data from multiple perspectives. Mining architecture extends this environment with statistical, machine-learning, visualization, and decision-support components.
Modern organizations also use data lakes and lakehouses. These platforms support large volumes of structured, semi-structured, and unstructured data, often retaining data in relatively raw form until it is required. The central architectural challenge is not simply storing more data; it is ensuring that data is trustworthy, discoverable, secure, timely, and suitable for the intended analytical task.
Learning Objectives
After studying this chapter, a student should be able to:
distinguish operational databases, data warehouses, data marts, data lakes, and lakehouses;
explain relational and multidimensional data models;
describe ETL and ELT pipelines and their quality controls;
perform and interpret common OLAP operations;
explain the role of metadata, governance, and security;
compare architectures used for enterprise data mining; and
evaluate an analytical architecture for a practical organizational scenario.
1. Operational Data and Analytical Data
Operational systems support routine business transactions. A banking system records deposits and withdrawals; a retail system records sales; and a hospital information system records encounters and treatments. These systems are optimized for frequent inserts, updates, and small, highly reliable transactions. Their schemas are commonly normalized to reduce redundancy and maintain consistency.
Analytical systems answer questions such as:
Which products are most profitable in each region?
How has customer retention changed over five years?
Which operational conditions are associated with equipment failure?
These queries often scan large volumes of historical data, join many subject areas, calculate aggregates, and compare periods. Running them on operational systems can degrade transaction performance and may be difficult when historical values have been overwritten. Analytical environments therefore separate decision-support workloads from transaction-processing workloads.
A useful distinction is between OLTP and OLAP:
Characteristic
OLTP
OLAP
Primary purpose
Record transactions
Analyze trends and relationships
Data orientation
Current operational state
Historical and integrated
Typical queries
Short and predictable
Complex and exploratory
Design emphasis
Write performance and integrity
Read performance and analytical flexibility
Users
Clerks, applications, operational staff
Analysts, managers, data scientists
The separation need not always mean separate physical products, but it does require deliberate workload, data, and governance design.
2. Data Warehouses and Data Marts
A data warehouse is a centralized or logically integrated repository designed to support reporting, analysis, and decision making. A classical warehouse is often described as:
Subject-oriented: organized around subjects such as sales, customers, products, or claims;
Integrated: data from different sources is reconciled into common formats and meanings;
Time-variant: historical values are retained and associated with time;
Non-volatile: analytical data is generally loaded and queried rather than continuously updated by end users.
These properties are design goals rather than absolute rules. Modern warehouses can support near-real-time ingestion and controlled corrections, but they remain primarily analytical systems.
A data mart is a smaller analytical store focused on a department, process, or subject. A dependent data mart is populated from an enterprise warehouse and benefits from common definitions. An independent data mart is built directly from departmental sources. Independent marts may deliver rapid local results, but they can create inconsistent measures, duplicated pipelines, and conflicting definitions of terms such as “customer” or “net revenue.”
A warehouse may use a centralized enterprise model, a dimensional model, or a combination. The appropriate choice depends on integration requirements, query patterns, organizational structure, and governance maturity.
3. Relational and Dimensional Data Models
3.1 Relational modeling
The relational model represents data in relations, commonly implemented as tables. Rows represent records and columns represent attributes. Primary keys identify rows, while foreign keys represent relationships between tables. Normalization separates facts into related tables to reduce update anomalies.
For example, a normalized sales design may contain Customer, Product, Store, Order, and OrderLine tables. A query for regional sales may need to join several tables. This design is excellent for transaction integrity, but repeated analytical joins can be expensive and difficult for non-specialist users.
3.2 Dimensional modeling
Dimensional modeling organizes analytical data around a fact table and associated dimension tables. A fact table contains measurements, such as quantity, sales amount, discount, or cost, together with foreign keys to dimensions. Dimensions provide descriptive context, such as date, product, customer, store, and sales channel.
The most important dimensional-design decision is the grain: the exact meaning of one row in a fact table. For example, the grain may be “one product line on one invoice” or “one daily inventory snapshot for one product at one warehouse.” Every measure must be interpreted at this grain.
A star schema has one central fact table connected directly to relatively denormalized dimensions. A snowflake schema normalizes one or more dimensions into additional tables. Star schemas are generally easier for users and often require fewer joins; snowflake schemas can reduce duplication and support more structured hierarchies, but may increase query complexity.
A fact table may contain:
Additive measures, which can be summed across all relevant dimensions, such as units sold;
Semi-additive measures, which can be summed across some dimensions but not time, such as account balance;
Non-additive measures, which should not be summed, such as percentages or unit prices. These should usually be recalculated from appropriate base measures.
Dimensions may be conformed, meaning that the same dimension and definition is shared across fact tables. A conformed Date or Product dimension supports consistent analysis across sales, inventory, and returns.
3.3 Slowly changing dimensions
Operational attributes change over time. A customer may move to a new region, or a product may be reassigned to a category. A warehouse must decide whether historical reports should reflect the current value or the value that applied when the event occurred.
Common strategies include:
Type 1: overwrite the old value; history is not retained.
Type 2: create a new dimension row with effective dates or a version identifier; history is retained.
Type 3: store limited previous and current values in additional columns.
Type 2 is useful when historical analysis must preserve the context at the time of a transaction. It increases storage and requires careful management of effective dates and surrogate keys.
4. ETL, ELT, and Data Quality
Data integration transfers data from source systems into an analytical platform. The traditional sequence is ETL: extract, transform, and load. Data is extracted, cleaned and standardized in a processing area, and then loaded into the warehouse. In ELT, raw or lightly processed data is loaded first and transformations are executed inside the target platform. Cloud warehouses and lakehouses often make ELT attractive because they provide scalable compute close to the data.
A practical pipeline includes the following stages:
Transformation: standardize codes, resolve identities, derive attributes, and apply business rules.
Integration: map data to conformed dimensions and fact-table grain.
Loading: insert or merge data into warehouse or lakehouse structures.
Reconciliation: compare source and target counts, totals, rejected records, and processing times.
Publication: expose certified tables, semantic models, dashboards, or mining datasets.
Important data-quality dimensions include accuracy, completeness, consistency, timeliness, validity, uniqueness, and fitness for purpose. A pipeline should not silently discard problematic records. It should quarantine them, report reasons for rejection, and assign responsibility for correction.
Change-data capture can identify inserted, updated, or deleted source records. Batch processing is suitable for many periodic workloads, whereas streaming or micro-batch processing is useful when decisions depend on recent events. “Real time” should be defined operationally; a system with a five-minute delay may be real-time enough for fraud monitoring but not for automated industrial control.
5. Metadata and Governance
Metadata is information about data. It allows users and systems to understand what a field means, where it originated, how it was transformed, who owns it, and whether it is suitable for a particular use.
Three useful categories are:
Business metadata: definitions, business rules, owners, classifications, and approved terms;
Technical metadata: schemas, data types, table locations, pipeline dependencies, and refresh schedules;
A data catalog makes metadata searchable. A business glossary distinguishes approved concepts from informal synonyms. Data lineage traces movement and transformation from source to report or model. Lineage is especially important when an analyst must explain a prediction, correct a faulty dashboard, or assess the impact of changing a source field.
Governance defines decision rights and controls for data. It includes ownership, stewardship, access management, retention, quality standards, privacy, security, and regulatory compliance. Governance should enable responsible use rather than merely impose documentation after systems have been built.
Sensitive data may require masking, tokenization, encryption, row-level security, column-level security, or restricted development environments. Access should follow least privilege. Audit logs should record access to sensitive datasets and administrative changes.
6. Data Lakes and Lakehouses
A data lake stores large volumes of structured, semi-structured, and unstructured data, often in object storage. It may contain raw source files, application events, documents, images, logs, and curated analytical tables. The lake supports flexible exploration and postpones some schema decisions until data is read, a property often called schema-on-read.
A lake can become a data swamp if it lacks ownership, cataloging, quality controls, lifecycle policies, and discoverable structure. Raw storage alone does not create analytical value.
A lakehouse combines lake-style storage flexibility with warehouse-like management features. Common capabilities include transactional consistency, schema enforcement or evolution, versioning, partition management, governance, and support for SQL and machine-learning workloads. The distinction between warehouse and lakehouse is implementation-dependent; the important question is whether the platform provides the reliability, performance, and governance required by its users.
Platform
Strength
Typical risk
Data warehouse
Governed SQL analytics and consistent reporting
Cost or rigidity for very diverse data
Data lake
Flexible, economical storage for varied data
Poor quality and discoverability
Lakehouse
Unified analytics and machine-learning foundation
Architectural complexity and platform dependence
Data mart
Focused departmental delivery
Inconsistent definitions across departments
7. OLAP and Multidimensional Analysis
OLAP represents measures across dimensions and hierarchies. A sales cube might contain the measure Sales Amount and dimensions Date, Product, Geography, and Channel. The term “cube” is conceptual; implementation may use relational tables, columnar storage, materialized aggregates, or a specialized multidimensional engine.
Common OLAP operations are:
Roll-up: aggregate to a higher level, such as city to state or month to quarter.
Drill-down: move to more detail, such as year to quarter to month.
Slice: select one value of a dimension, such as sales for 2025 only.
Dice: select ranges or sets across several dimensions, such as electronics sold online in two regions.
Pivot: rotate the presentation so different dimensions appear in rows, columns, or pages.
Drill-through: move from an aggregate result to the detailed records supporting it.
Hierarchies must be valid. A geography hierarchy may be Country → State → City, while a calendar hierarchy may be Year → Quarter → Month → Day. Fiscal calendars, irregular organizations, and many-to-many relationships require explicit modeling rather than assumptions.
Consider a fact table at the grain “one order line.” A report grouped by month and product category is a roll-up from individual order lines. Selecting only the online channel is a slice. Selecting online sales for two categories in two regions is a dice. Drilling from a yearly total to monthly results is a drill-down. These operations help analysts move between overview and detail without repeatedly redesigning the underlying data.
8. Architecture for Enterprise Data Mining
An enterprise mining architecture commonly contains the following layers:
Consumption layer: dashboards, reports, alerts, applications, decision workflows, and model APIs.
Governance and security layer: identity, authorization, cataloging, lineage, quality, privacy, monitoring, and audit.
A mining dataset should be designed for the analytical objective. It must define the unit of analysis, observation period, target variable, predictors, and permissible information at prediction time. A warehouse may contain a customer’s later purchase, but using that value to predict an earlier purchase creates target leakage. Thus, good mining architecture requires temporal discipline, not merely technical connectivity.
Feature stores can provide reusable, documented features for machine-learning models. Model registries record versions, training data, evaluation results, approvals, and deployment status. Monitoring should check data drift, prediction quality, latency, and fairness where appropriate. A model is part of an information system and must be governed throughout its life cycle.
Layered enterprise data mining architecture
Figure: Layered enterprise data mining architecture
Figure: A layered architecture connecting enterprise sources to analytical consumption, with cross-cutting governance and monitoring.
9. Applied Case: Retail Inventory and Demand Mining
Background. This illustrative case concerns a retailer operating stores and an online channel. Sales, inventory, promotions, supplier deliveries, and customer interactions are stored in separate systems.
Problem. Managers receive conflicting reports about stock-outs and promotion performance. Analysts also find that product categories and store identifiers differ between systems. A data-mining team wants to forecast demand and identify products likely to become unavailable.
Analysis. The team first defines the grain of the sales fact table as one product line per order. It defines a daily inventory snapshot separately because inventory is semi-additive across time. A conformed Date, Product, Store, and Channel dimension is established. Product-category changes are handled with Type 2 history because management needs to evaluate promotions using the category valid at the time of sale.
Approach. Source data is landed in a lake with ingestion timestamps and source identifiers. Validated and standardized data is loaded into a warehouse. Certified measures distinguish gross sales, discounts, returns, units, and net sales. OLAP reports support roll-up from store to region and drill-down from month to day. A mining dataset uses only information available before each forecast date, avoiding leakage from future sales or later inventory corrections. Data-quality rules compare source totals with warehouse totals and quarantine invalid product codes.
Outcome. Managers obtain one governed definition of stock-out rate and promotion sales. Analysts can investigate an aggregate alert through drill-through to order and inventory records. The mining process becomes repeatable because feature definitions, data lineage, and model versions are documented.
Learning points. The case demonstrates that successful mining depends on grain, history, quality, semantics, and governance. A sophisticated algorithm cannot repair ambiguous business definitions or contaminated training data.
10. Challenges, Limitations, and Best Practices
Data warehouses can become expensive when storage, computation, duplication, and poorly designed queries grow without control. Data lakes can become difficult to use when raw data lacks metadata and ownership. Multiple tools can create duplicated pipelines and inconsistent security policies. Streaming architectures introduce ordering, late-arriving events, replay, and exactly-once or effectively-once processing concerns.
Organizations should establish a source-of-truth strategy, but should not assume that every question requires one physical repository. A governed logical architecture may combine warehouses, lakes, marts, and specialized systems. Cost management should include workload monitoring, partitioning, clustering, retention, caching, and appropriate service tiers. Performance tuning should be based on observed query and pipeline behavior rather than fashionable technology choices.
Ethical and regulatory concerns include unauthorized disclosure, excessive retention, discriminatory outcomes, re-identification, and unclear accountability. Personal data should be collected and used for legitimate, documented purposes. De-identification is not automatically irreversible, particularly when datasets can be linked. Access controls, consent or lawful basis where applicable, retention limits, incident response, and impact assessment should be incorporated into design.
Recommended practices include:
define fact-table grain before selecting measures;
establish a business glossary and ownership model;
use conformed dimensions for shared organizational concepts;
record lineage, quality results, and pipeline failures;
separate raw, validated, and certified data zones;
design for incremental processing and replay where appropriate;
test for leakage, drift, bias, and temporal validity in mining datasets;
protect sensitive data through least privilege and appropriate encryption; and
measure architecture success through reliability, usability, analytical quality, and business value.
Contemporary Developments
Cloud-native warehouses and lakehouses increasingly separate storage from compute, allowing elastic processing and multiple analytical workloads. Data mesh emphasizes domain ownership and data products, while still requiring interoperable governance and common standards. Data fabric approaches use metadata, integration, and automation to connect distributed data environments.
Generative AI and natural-language interfaces can help users formulate queries, document pipelines, and explore metadata. However, generated queries may contain incorrect joins, inappropriate filters, or unauthorized data access. Human review, semantic models, query controls, and auditability remain essential. AI does not eliminate the need for reliable warehouse design; it increases the importance of clear definitions and governed access.
Chapter Summary
Data warehousing separates analytical workloads from transaction processing and provides integrated, historical, subject-oriented data. Relational models emphasize integrity and normalization, whereas dimensional models emphasize understandable and efficient analysis through facts, dimensions, grain, hierarchies, and conformed definitions. ETL and ELT pipelines extract, validate, transform, and load data while preserving quality and lineage. OLAP supports roll-up, drill-down, slice, dice, pivot, and drill-through operations across multidimensional structures.
Data lakes provide flexible storage for diverse data, while lakehouses seek to combine this flexibility with warehouse-like reliability and governance. Metadata, catalogs, lineage, security, privacy, and stewardship are essential to trustworthy analytics. An enterprise mining architecture connects sources, ingestion, storage, semantic models, analytical tools, and decision applications. Mining projects must also control temporal leakage, define the unit of analysis, and monitor models after deployment. Effective architecture is therefore a socio-technical system involving technology, business meaning, governance, and responsible use.
Key Terms
Data warehouse: Governed analytical repository containing integrated and historical data.
Data mart: Analytical store focused on a department, process, or subject.
OLTP: Systems optimized for routine transaction processing.
OLAP: Analytical processing across dimensions, measures, and hierarchies.
Fact table: Dimensional table containing measurements and dimension keys.
Dimension table: Descriptive context used to analyze facts.
Grain: Precise meaning represented by one fact-table row.
Star schema: Fact table connected directly to denormalized dimensions.
Snowflake schema: Dimensional schema with normalized dimensions.
Conformed dimension: Shared dimension with consistent meaning across facts.
ETL: Extract, transform, and load data into an analytical target.
ELT: Extract, load, and transform data within the target platform.
Metadata: Information describing data, its meaning, origin, and processing.
Data lineage: Trace of data movement and transformation.
Data lake: Flexible repository for diverse data, often in raw form.
Lakehouse: Platform combining lake storage flexibility with warehouse controls.
Roll-up: Aggregation to a higher level in a hierarchy.
Drill-down: Movement from aggregate information to greater detail.
Slowly changing dimension: Dimension whose attributes change over time and require a history policy.
Target leakage: Use of information unavailable at prediction time in a mining dataset.
Review Questions
Short Answer Questions
What distinguishes OLTP from OLAP workloads?
Why is the grain of a fact table important?
Define ETL and ELT.
What is metadata, and why is lineage useful?
Name and explain any three OLAP operations.
Long Answer Questions
Compare relational and dimensional modeling, including star and snowflake schemas.
Explain a complete ETL/ELT pipeline and the data-quality controls it should contain.
Compare data warehouses, data lakes, data marts, and lakehouses.
Describe the layers of an enterprise data-mining architecture.
Explain slowly changing dimensions and compare Types 1, 2, and 3.
Analytical / Application Questions
Design the grain, facts, and dimensions for a university course-enrollment warehouse. Justify how you would model enrollment history.
An organization’s dashboard shows different revenue totals in sales and finance systems. Propose a diagnostic and governance approach using reconciliation, metadata, lineage, and conformed dimensions.
A retailer wants to predict stock-outs using historical warehouse data. Explain how you would prevent target leakage, handle inventory snapshots, and monitor the resulting mining pipeline.
Multiple Choice Questions with Answers
Question 1
Which characteristic is most strongly associated with a classical data warehouse?
A. Subject-oriented, integrated, historical data
B. Only current data for transaction entry
C. Unvalidated data with no defined ownership
D. Exclusive support for real-time device control
Correct Answer: A. Subject-oriented, integrated, historical data
Question 2
In dimensional modeling, what does the grain of a fact table specify?
A. The compression algorithm used for storage
B. The exact meaning of one row
C. The number of dimensions available
D. The maximum query duration
Correct Answer: B. The exact meaning of one row
Question 3
Which OLAP operation moves from yearly sales totals to monthly sales details?
A. Slice
B. Pivot
C. Drill-down
D. Roll-up
Correct Answer: C. Drill-down
Question 4
Which measure is usually semi-additive?
A. Units sold
B. Order count
C. Account balance
D. Product category
Correct Answer: C. Account balance
Question 5
What is the main purpose of a Type 2 slowly changing dimension?
A. To overwrite all historical values
B. To preserve changes by creating historical dimension versions
C. To remove dimension attributes
D. To convert a fact table into a data lake
Correct Answer: B. To preserve changes by creating historical dimension versions
Question 6
In ELT, where are transformations generally performed?
A. Only in the source application
B. Inside the analytical target platform
C. Only on the end user’s device
D. After the report has been published
Correct Answer: B. Inside the analytical target platform
Question 7
Which metadata type records pipeline failures and row counts?
A. Business metadata
B. Technical metadata
C. Operational metadata
D. Legal metadata
Correct Answer: C. Operational metadata
Question 8
Which problem can occur when a data lake lacks cataloging and quality controls?
A. It becomes a data swamp
B. It automatically becomes a star schema
C. It prevents all data ingestion
D. It guarantees inconsistent encryption
Correct Answer: A. It becomes a data swamp
Question 9
What is target leakage in a mining dataset?
A. Loss of data caused by compression
B. Use of information unavailable when the prediction would be made
C. A duplicate dimension key
D. A delayed dashboard refresh
Correct Answer: B. Use of information unavailable when the prediction would be made
Question 10
Which design feature best supports consistent analysis across sales and inventory fact tables?
A. Independent definitions of product in each table