# Data warehouse

> A data warehouse is a central database designed for analysis, where cleaned data from many business systems is stored together so teams can run reports, dashboards and AI queries across all of it.

Also called: DWH, analytics database, cloud data warehouse, data lakehouse. Category: Data and retrieval. Source: https://aibuildindex.com/glossary/data-warehouse

## In the index

- BigQuery: median $9,840, middle half $2,580 to $21,600, 70 priced briefs (https://aibuildindex.com/tools/bigquery)
- Snowflake: median $14,400, middle half $5,000 to $30,400, 39 priced briefs (https://aibuildindex.com/tools/snowflake)
- Business intelligence: median $4,900, middle half $1,300 to $10,800, 112 priced briefs (https://aibuildindex.com/skills/business-intelligence)

Operational systems such as a CRM, shop or accounting package are built to run the business one record at a time. They are poor at answering questions across years of history and several systems at once. A data warehouse is a separate database designed for exactly that: it holds a copy of data from many sources, organised for analysis. For AI builds it is often the foundation for forecasting, dashboards and assistants that answer questions about the numbers.

## How it works

Data reaches the warehouse through [ETL](https://aibuildindex.com/glossary/etl) or ELT [pipelines](https://aibuildindex.com/glossary/data-pipeline). Inside, it is usually arranged into fact tables, such as orders or payments, and dimension tables, such as customers, products or dates, a layout that makes reporting queries fast and understandable. Cloud warehouses such as Google BigQuery, Snowflake, Amazon Redshift and Azure Synapse separate storage from compute, so large queries can run without slowing the business systems that produced the data.

A related term is the data lake, which stores raw files of any format cheaply, and the lakehouse, which adds warehouse-style tables on top of a lake. For most small and mid-sized buyers, a warehouse, or even a well-organised PostgreSQL database, is enough.

AI fits on top in several ways. [Text-to-SQL](https://aibuildindex.com/glossary/text-to-sql) assistants let staff ask questions in plain English and get answers from warehouse tables. [Forecasting](https://aibuildindex.com/glossary/forecasting) and [predictive analytics](https://aibuildindex.com/glossary/predictive-analytics) models train on the warehouse's history.

## What it means for cost

Setting up a warehouse is rarely the expensive part; getting good data into it is. Costs depend on how many sources need connecting, how much cleaning and reconciliation they need, and how clearly the business has defined its metrics. Two departments with different definitions of "active customer" will produce two different numbers until someone decides.

Running costs on cloud warehouses depend on storage and on the volume of data each query scans, so poorly designed queries or dashboards that refresh too often can raise the bill. Ask a builder how the tables will be modelled, how metrics are defined and documented, and how query costs are monitored.

## Common questions

### Does an AI project need a data warehouse?

Not always. A document assistant does not; it needs a search index. Projects that analyse numbers across several systems, such as forecasting, reporting assistants or churn prediction, usually benefit from one, because the model needs clean, joined history.

### What is the difference between a database and a data warehouse?

Both store data. An application database is tuned for many small reads and writes as the business runs. A warehouse is tuned for large analytical queries across lots of history, and usually combines data from several applications.

## Related terms

- [ETL (extract, transform, load)](https://aibuildindex.com/glossary/etl): ETL, short for extract, transform, load, is the process of copying data out of source systems, cleaning and reshaping it into a consistent form, and loading it into a destination such as a data warehouse or reporting database.
- [Data pipeline](https://aibuildindex.com/glossary/data-pipeline): A data pipeline is an automated series of steps that moves data from one or more sources to a destination, transforming, checking and enriching it along the way, on a schedule or as new data arrives.
- [Text-to-SQL](https://aibuildindex.com/glossary/text-to-sql): Text-to-SQL is an AI technique in which a language model turns a plain-English question, such as "what were sales by region last quarter", into a SQL query, runs it against a database and returns the answer.
- [Forecasting](https://aibuildindex.com/glossary/forecasting): Forecasting is the use of historical data and statistical or machine learning models to estimate future values, such as next month's sales, call volumes or stock needs, usually with a range that shows how uncertain the estimate is.
- [Predictive analytics](https://aibuildindex.com/glossary/predictive-analytics): Predictive analytics is the use of historical data and statistical or machine learning models to estimate the likelihood of future outcomes for individual cases, such as which customers will churn, which leads will convert or which invoices will be paid late.
- [Data cleaning](https://aibuildindex.com/glossary/data-cleaning): Data cleaning is the work of finding and fixing errors, duplicates, gaps and inconsistencies in a dataset, such as mismatched formats or misspelt names, so that reports, automations and AI models built on it give reliable results.
