Learning Objectives

By the end of this chapter, you will be able to:

  • Define a warehouse versus OLTP and state its analytical purpose.
  • Explain the four properties of subject oriented, integrated, time variant, and non volatile.
  • Describe ETL and its quality role.
  • Distinguish warehouse from data mart and state when each fits.

Why Analysis Needs Its Own Store

A transaction system records one event correctly and fast. An analytical system answers a question over millions of events. Running heavy analytics on the live database slows counters and lets two reports pulled an hour apart disagree.

A data warehouse creates a separate analytical store. It gathers data from many sources, cleans and aligns it, and keeps it as long running history prepared for querying. Users query the warehouse, not the live system. A data mart is a focused slice of that warehouse shaped for one domain or team so questions answer faster and ownership is clearer.

flowchart LR
    S1["ERP"] & S2["Core and CRM"] & S3["Web and App"] --> ETL["ETL\nExtract\nTransform\nLoad"] --> DW[("Warehouse\nSingle source\nfor analysis")] --> DM1["Sales Mart"] & DM2["Risk Mart"] & DM3["Branch Mart"] --> BI["BI Reports\nOLAP"]
    style DW fill:#1565c0,color:#fff
    style BI fill:#2d5016,color:#fff

Figure 1: Sources through ETL to warehouse, marts, and BI

Aspect OLTP operational OLAP analytical
Purpose Run the business Analyse the business
Data Current, detailed, normalized for updates Historical, summarized, dimensional for scans
Workload Many short writes and reads Few heavy reads over millions of rows
Update Transaction by transaction Periodic batch, read mostly

Four Properties That Define A Warehouse

Property Meaning What it fixes
Subject oriented Organized around Customer, Product, Time, Branch One customer view instead of one screen view
Integrated Names, codes, units, and keys aligned in ETL Double counts and mismatched dates removed
Time variant History kept for years, every fact time stamped Trend and cohort analysis possible
Non volatile Once loaded, history is not overwritten; new loads append Year on year comparison stays valid

ETL: Where Quality Is Decided

Extract pulls from sources on schedule. Transform cleans, deduplicates, standardizes codes, validates ranges, and conforms keys. Load appends to warehouse tables without destroying history, often into dimensional structures that make slicing quick. Quality is enforced in transform, with rejects quarantined for correction at source.

Warehouse Versus Data Mart

Dimension Warehouse Data mart
Scope Enterprise, many subjects One subject or business unit
Users Cross functional analysts One department
Build cost and time Larger and longer Smaller, quicker win
Risk Single large delivery risk Needs conformed dimensions to avoid drift

Good designs use dependent marts fed from the warehouse with shared dimensions such as Customer and Time, so the same definition is used everywhere. Independent marts built directly from sources recreate silos.

Worked Example: A Commercial Bank In BS 2081

A bank in Kathmandu runs four systems that disagree on customer keys: core banking, card, mobile, and loans. Questions such as which salary holders use mobile heavily but never borrowed cannot be answered from any single system.

ETL nightly between 11 pm and 2 am: extract all four systems plus branch table, transform by matching customer on citizenship and core ID, standardize dates to AD and BS, validate sector, quarantine 1.6 percent with missing sector, then load and append by transaction date with five year retention.

Marts:

Mart Users Question
Marketing mart Marketing Which segments respond to card offers
Risk mart Risk How arrears shifted by sector since 2076
Branch mart Branch managers Deposits versus same month prior year

A marketing query on the mart answers in 7 seconds versus 11 minutes on the live loan table during counter hours, and the batch window prevents analytical load from competing with posting.

Self-Check Name one analytical question your organization asks repeatedly. State which sources it needs and whether the answer belongs in a warehouse or a single mart.

Try This A mart costs Rs. 520,000 to build and Rs. 14,000 per month to run including ETL share. It saves analysts 38 hours per month at Rs. 650 per hour and avoids one manual extract per week at Rs. 3,200 each. Compute monthly gross saving, net saving, and payback months.

Answers: Analyst 38 times 650 equals Rs. 24,700. Extract 4.33 times 3,200 equals Rs. 13,856. Gross Rs. 38,556. Net 38,556 minus 14,000 equals Rs. 24,556. Payback 520,000 divided by 24,556 equals 21.18 months, so month 22.

Summary

Warehouses and marts exist so analysis does not compete with transactions. Warehouses are subject oriented, integrated, time variant, and non volatile, delivered through ETL that enforces quality. Marts deliver the same data shaped for one team, and when fed from the warehouse with conformed dimensions they provide fast, consistent answers.

Key Takeaways

  • Separate analytical and transactional stores.
  • The four warehouse properties must be named and explained.
  • ETL is where integration and quality happen.
  • OLAP prefers dimensional shape for scans; OLTP prefers normalized shape for writes.
  • Dependent marts with conformed dimensions prevent new silos.

Discussion Questions

  1. Why should last month’s corrected report not overwrite warehouse history?
  2. Why do two marts built directly from sources give different customer counts?
  3. When is a single mart a better first step than an enterprise warehouse for an SME?

Exercises

Short answer

  1. Distinguish OLTP from OLAP.
  2. State the four warehouse properties.
  3. What does ETL stand for and what does each phase do?
  4. Distinguish warehouse from data mart.

Long answer

  1. Explain warehouse characteristics and purpose with the bank case in BS 2081. Trace one question from sources through ETL to mart.
  2. A firm runs trend reports on its live database and complains of slowness and inconsistency. Diagnose with OLTP versus OLAP and propose a warehouse and mart design.