Warehousing for Analytics
The engine room every dashboard trusts
A data warehouse is where business data is loaded, modeled, and queried for decisions. This module explains how warehouses differ from operational databases and why they are the engine room of analytics.
What you will learn
- Distinguish OLTP from OLAP workloads
- Explain why analytics needs its own storage layer
- Name the main warehouse options and their trade-offs
What is this?
A data warehouse is a read-optimized store built for analytics queries. Operational databases (OLTP) are tuned for fast transaction writes; warehouses (OLAP) are tuned for scanning and aggregating large histories. Analysts query warehouses through modeled layers rather than raw production databases, isolating reporting traffic from live applications.
Why do you need it?
- Queries against production databases compete with live traffic and hurt the app.
- Analytics need history, snapshots, and reshaping that operational schemas do not provide.
- Warehouses separate 'can we analyze?' from 'is the app fast?'
Mental model
A store's live point-of-sale system
The centralized inventory warehouse
The counter (OLTP) handles one order at a time quickly; the warehouse (OLAP) exists so you can run reports over every sale ever, without slowing the counter.
How it works
- Pipeline tools extract from sources and load into the warehouse (ELT).
- Raw tables are transformed into modeled layers for specific questions.
- BI tools and notebooks query the modeled layer for dashboards and analysis.
- Compute and storage separate in cloud warehouses, so scale comes as usage does.
Sources load raw; models shape it; dashboards read the modeled layers.
In production
- A fintech runs its P&L dashboards from a warehouse modeled nightly.
- An e-commerce team joins orders, sessions, and support into one revenue mart.
- A retail chain loads per-store sales raw and lets analysts self-serve daily.
Best practices
- Keep raw loads immutable and transform into clean layers — never edit raw.
- Define the warehouse schema around business questions, not source systems.
- Let dashboards read models, never live production databases.
Common mistakes
- Pointing dashboards at production OLTP replicas and paying for it in both places.
- Loading without modeling until every dashboard re-does the same joins.
- Choosing one giant raw buck for all traffic so every query scans the world.
Debugging tips
- Slow dashboards usually mean a heavy scan of raw — route them to a modeled mart.
- Disagreements between warehouse numbers point at duplicated modeling logic, not the warehouse.
Interview checkpoint
Quick quiz
OLAP workloads are optimized for
Dashboards should read from