A data warehouse is a database designed for analysis rather than for running an application. It collects cleaned, historical data from several source systems into one place, so that reports and large queries run without slowing down the systems that record the day-to-day transactions.
The rest of this guide covers why the split exists, how data gets into a warehouse, how the tables are usually shaped, and how a warehouse differs from a data lake.
What a data warehouse does
Businesses record what happens in operational databases: an order is placed, a payment arrives, stock moves. Microsoft's documentation calls these online transaction processing (OLTP) systems and notes that they are optimized for individual record entries. They hold valuable information, but they are not designed for analysis, so retrieving data from them for reports is slow and difficult.
A warehouse is the answer to that problem. Microsoft's OLAP guide describes the analytical side as databases optimized for heavy-read, low-write tasks, modeled and cleansed for effective analysis, and often preserving historical data for time-series analysis. It also describes the warehouse as the thing that gives every user a single source of truth: when everyone reads from the same warehouse, different reports stop producing different numbers for the same metric.
Data warehouse vs. operational database (OLTP)
The two are built for opposite workloads. The traits below come from Microsoft's OLTP and OLAP reference pages.
| Trait | Operational database (OLTP) | Analytical store (OLAP / warehouse) |
|---|---|---|
| Typical workload | Heavy writes, moderate reads | Heavy reads, read-only for users |
| Data shape | Highly normalized | Star or snowflake schema (cube in older designs) |
| Transactions | Yes, with ACID guarantees | Not used for analysis queries |
| Typical scale | Megabytes to a few terabytes | Hundreds of gigabytes to multiple petabytes |
| Freshness | Immediate | Refreshed on a schedule, often slower than the source |
Running analytics directly on an OLTP system has a concrete cost. Microsoft notes that aggregate calculations over millions of individual transactions are resource-intensive for an OLTP system, and can slow down or block other transactions. Highly normalized tables also make reporting queries complicated, because most of them need many joins to put the data back together. The common remedy is to keep a recent window of time, such as the current fiscal year, in the operational system and offload history to a data mart or data warehouse.
The trade-off is freshness. A warehouse is typically refreshed at slower intervals than the source systems, so it suits strategic decisions better than immediate reactions to change. If you need second-by-second numbers, a warehouse alone is the wrong tool.
How data gets into a warehouse: ETL and ELT
A warehouse does not collect data by itself. A pipeline moves it from the source systems. Microsoft defines extract, transform, load (ETL) as a data integration process that consolidates data from diverse sources into a unified data store. The transformation step applies business rules and often uses staging tables that hold data temporarily. Typical transformations include filtering, sorting, aggregating, joining, cleaning, deduplicating and validating.
Extract, load, transform (ELT) differs only in where the transformation happens. The raw data is loaded first, and the target system does the transformation using its own compute. Microsoft says this simplifies the architecture by removing the separate transformation engine, and that scaling the target also scales the pipeline. It also warns that ELT only works well when the target system is powerful enough to transform the data efficiently. Modern cloud warehouses with elastic compute are the usual fit.
Both approaches usually run in scheduled batches. For background on that pattern, see what batch processing is.
How the tables are organized: star schema
Instead of normalized tables, warehouses typically use a star or snowflake schema. Microsoft's OLAP guide states that OLAP data models tend to be multidimensional and that these systems use a star or snowflake schema instead of traditional normalization. In a star schema, one central table records events or measurements, and smaller surrounding tables describe them.
The table names below are invented for illustration. A sales warehouse might have a central fact_sales table with one row per order line (date key, product key, store key, quantity, amount) and dimension tables dim_date, dim_product and dim_store that hold the descriptive columns. A typical question then needs one fact table and a few small joins:
SELECT d.calendar_year,
p.category,
SUM(f.amount) AS total_sales
FROM fact_sales AS f
JOIN dim_date AS d ON d.date_key = f.date_key
JOIN dim_product AS p ON p.product_key = f.product_key
GROUP BY d.calendar_year, p.category
ORDER BY d.calendar_year, total_sales DESC;
This is an example query, not output from a real system. The pattern is what matters: descriptive columns such as year and category live in the dimensions, while the numbers you add up live in the fact table. The same question against a normalized order-entry schema would usually touch more tables and be harder for a business user to write.
Most warehouses are queried with SQL. Microsoft Fabric Data Warehouse, for instance, is primarily developed with T-SQL. If you work with SQL Server or Azure, see what T-SQL is.
Data warehouse vs. data lake
A data lake is a storage repository that holds large volumes of data in its native, raw format: relational tables, JSON, XML, log files, images and more. It applies transformation only when the data is needed, which Microsoft calls schema-on-read. A warehouse enforces structure and applies transformations as it ingests data, which is schema-on-write.
| Feature | Data lake | Data warehouse |
|---|---|---|
| Data type | Raw: structured, semistructured and unstructured | Structured, curated, relational schemas |
| Structure applied | At query time (schema-on-read) | At load time (schema-on-write) |
| Best fit | Big data, machine learning, exploratory analytics | Business intelligence, reporting, structured analysis |
| Cost profile | Lower storage cost, compute charged when processing | Higher, because of dedicated compute and optimization |
The two are not rivals. Microsoft describes a lake functioning as the upstream source for a warehouse: raw data lands in the lake, and the warehouse transforms it into structured form. A lakehouse combines both ideas. Microsoft Fabric's documentation, for example, describes its warehouse as an enterprise-scale relational warehouse on a data lake foundation, with data stored as Delta tables (Parquet files plus a transaction log).
Where a semantic layer fits
Business users rarely write the SQL above. Microsoft's guide notes that a semantic layer is traditionally placed over a data warehouse to supply friendly names, relationships and agreed calculations. That is why two analysts using the same dashboard get the same revenue figure. For more on that idea, see what a semantic layer is.
When you do not need one
A warehouse adds a second system, a pipeline to maintain, and a delay between an event and its appearance in reports. If your reporting queries run acceptably against the application database and do not interfere with transactions, keep things simple. Microsoft also notes that most workloads are not entirely OLTP, and that hybrid transactional and analytical processing (HTAP) can run both kinds of work on the same platform, for example with columnstore indexes in SQL Server and Azure SQL Database. That removes the need for separate copies of the data in some cases.
A warehouse starts to pay off in these situations:
- Analytical queries slow the application or block other transactions.
- You need to combine data from several systems into one consistent set of numbers.
- You need to keep years of history that the operational system should not carry.
- Business users need to build reports without learning the structure of the operational schema.
Common problems
- Stale numbers. The warehouse is only as current as its last load. Check when the pipeline last ran before trusting a figure.
- Pipeline maintenance. Microsoft lists data cleansing and orchestration as work you must plan to keep an analytical store up to date.
- Mismatched definitions. If source systems use the same term for different things, the warehouse model has to settle the meaning once, or the single source of truth is not one.
Frequently asked questions
- Is a data warehouse the same as a database?
- A data warehouse is a kind of database, but it is organized for a different job. An operational (OLTP) database is tuned for many small writes such as orders and payments. A warehouse is tuned for heavy reads: large aggregate queries over historical data that has been cleaned and modeled for analysis.
- What is the difference between a data warehouse and a data lake?
- A data lake stores raw data in its original format and applies structure when the data is read (schema-on-read). A data warehouse enforces structure when the data is loaded (schema-on-write) and holds curated, relational data. Many organizations use both, with the lake feeding the warehouse.
- Do I need a data warehouse for a small project?
- Usually not. If your reports run quickly against your application database and the queries do not slow the application down, a separate warehouse adds cost and pipeline work without a clear benefit. The need appears when analytics queries compete with transactions, or when you must combine data from several systems.
- What language do you use to query a data warehouse?
- Mostly SQL. Microsoft Fabric Data Warehouse, for example, is primarily developed with T-SQL. Other products use their own SQL dialects, so syntax details vary by vendor.