Data Warehouse vs Data Lake Compared
Data warehouse vs data lake compares two analytics stores. A data warehouse holds cleaned, structured data in modelled tables, with the schema applied on write, for fast SQL reporting. A data lake keeps raw data of any type as files on low cost storage, with the schema applied on read, for exploration and machine learning.
The data warehouse vs data lake question comes up once a team has more data than one application database can serve. Both stores sit at the end of a data pipeline. They differ in what they accept, when structure is imposed and who uses them.
What a data warehouse is
Inmon defines a data warehouse as a subject oriented, integrated, nonvolatile and time variant collection of data that supports management decisions. Data from many systems is merged around business subjects such as customers or products, and kept as history rather than overwritten.
Data is cleaned and shaped before it is stored. This is called schema on write. A row that does not fit the table definition is rejected or fixed in the pipeline.
Kimball’s dimensional modelling is the common design method. Measurements go into fact tables and descriptive context goes into dimension tables, arranged as a star schema. Business users then query it with SQL or a BI tool.
What a data lake is
James Dixon, then at Pentaho, coined the term “data lake” around 2010. As Fowler describes it, a lake stores data in its raw form, so the store does not decide in advance how the data will be used.
A lake accepts structured tables, semi structured JSON and logs, and unstructured images, audio and documents. Files usually sit on object storage or a distributed file system. Structure is applied by the query engine when the data is read, which is schema on read.
Without a catalog, owners and quality checks, a lake turns into a “data swamp” that nobody trusts.
Data warehouse vs data lake comparison table
| Feature | Data warehouse | Data lake |
|---|---|---|
| Data accepted | Structured, cleaned | Any: structured, semi structured, unstructured |
| Schema | On write, defined before loading | On read, applied by the query |
| Typical storage | Database tables, columnar inside the engine | Files on object storage (Parquet, ORC, JSON, CSV, images) |
| Main users | Business analysts, finance, managers | Data scientists, data engineers |
| Main workloads | SQL reporting, dashboards, KPIs | Exploration, machine learning, archiving raw history |
| Data quality | High, checked in the pipeline | Varies, depends on zones and checks |
| Agility for new questions | Lower, model changes needed | Higher, raw data is still there |
| Risk | Rigid, costly to change models | Data swamp without governance |
| Pipeline pattern | ETL or ELT into modelled tables | Mostly load raw first, transform later |
Differences explained
In a warehouse, the table design is a contract. Pipelines must convert units, fix keys and handle nulls before the data arrives, so every query sees the same clean shape.
In a lake, two teams can read the same raw file with different schemas. That helps exploration, but every reader has to repeat the cleaning unless a curated layer exists.
Lakes favour open file formats. Parquet, for example, is a columnar format: values from one column are stored together and compressed, so a query that needs a few columns reads only those.
Warehouses manage storage inside the engine. Most analytic warehouses also store data by column, but the user sees tables, not files.
A warehouse is built for people who ask known business questions in SQL and expect consistent numbers.
A lake suits people who need raw detail, such as data scientists training models on sensor history, text or images that would never fit a star schema.
Worked example: query cost on raw and columnar files
Many cloud query engines bill by the amount of data a query scans, so file format and layout decide cost. The prices below are assumed round figures for the arithmetic, not real vendor rates.
- Given
- A sensor table of 2 TB stored as uncompressed CSV in a data lake, with 30 columns of similar size. A converted copy in Parquet with a 4 to 1 compression ratio. A monthly report query reads 3 of the 30 columns and runs 20 times a month.
- Assumed price: 5 per TB scanned and 20 per TB stored per month (any currency).
- Find
- Data scanned per query and total monthly cost for CSV and for Parquet.
- Assumptions
- CSV is row based, so every query reads the whole file. Parquet reads only the needed columns. Columns compress equally. No partition pruning or caching.
- Solution
- CSV: scan per query = 2 TB, monthly scan = 20 × 2 = 40 TB, scan cost = 40 × 5 = 200, storage = 2 × 20 = 40, total = 240.
- Parquet: stored size = 2 / 4 = 0.5 TB, scan per query = 0.5 × 3/30 = 0.05 TB, monthly scan = 20 × 0.05 = 1 TB, scan cost = 1 × 5 = 5, storage = 0.5 × 20 = 10, total = 15.
- Answer
- CSV costs 240 per month and Parquet 15 per month; each Parquet query scans 40 times less data (0.05 TB instead of 2 TB).
- Limitations
- Real compression varies by column type, and real engines add minimum charges, caching and metadata reads. A warehouse that stores the same table by column would scan a similar amount.
So a lake is cheap only when its data is laid out well. Raw CSV is fine as a landing format, but heavily queried data should be converted to a columnar format.
Key formulas for query scan cost
| Quantity | Formula | Symbols and units |
|---|---|---|
| Data scanned per query (columnar) | raw size (TB), compression ratio, columns read, total columns | |
| Monthly cost | queries per month, price per TB scanned, stored size (TB), price per TB month |
When to use which
- If users need fixed KPIs and dashboards with agreed definitions, a warehouse is the core.
- Images, audio, free text and high volume logs belong in a lake, because they do not fit relational tables.
- SQL analysts work best on modelled warehouse tables; data scientists often want raw lake files.
- A lake needs a catalog, owners and zones (raw, cleaned, curated) from day one.
- Consider a lakehouse when you want one copy of data for both BI and machine learning.
The data lakehouse
Armbrust and co-authors describe the lakehouse as a platform that keeps data in open formats on low cost object storage, like a lake, and adds warehouse features on top. These include ACID transactions, schema enforcement, versioning and fast SQL.
Open table formats such as Delta Lake, Apache Iceberg and Apache Hudi provide that table layer over Parquet files. The layered raw, cleaned and business ready structure (bronze, silver, gold) is often used inside a lakehouse.
Why two copies of data cause trouble
With a separate lake and warehouse, data is copied from one to the other. Each copy needs its own pipeline, and the two can drift apart, so a dashboard and a model may disagree. Removing the second copy was a main motivation for the lakehouse in the Armbrust paper.
Related reading
- ETL vs ELT explains how data gets into either store.
- Big data and the five Vs covers volume, variety and velocity, which push teams toward lakes.
- SQL vs NoSQL compares the databases that often feed these stores.
- Database normalization contrasts with the denormalized star schema used in warehouses.
- The data science workflow shows where lake data is explored and modelled.
Data warehouse vs data lake interview and viva questions
- What is the main difference between a data warehouse and a data lake? A warehouse stores cleaned, structured data with the schema applied on write. A lake stores raw data of any type with the schema applied on read.
- What does schema on read mean? Structure is applied by the query engine when data is read, not when it is stored, so different users can read the same raw file in different ways.
- What are fact and dimension tables? In Kimball’s dimensional model, fact tables hold measurements and dimension tables hold the descriptive context, arranged as a star schema for SQL queries.
- Why is Parquet cheaper to query than CSV on a scan based engine? Parquet is columnar and compressed, so a query reads only the columns it needs. CSV is row based, so the whole file is read.
- What is a data lakehouse? It keeps data in open formats on object storage like a lake and adds warehouse features such as ACID transactions, schema enforcement and fast SQL through a table format layer.
Frequently asked questions
Can a company have both a data lake and a data warehouse?
Yes, and many do. Raw data lands in the lake, where data scientists can explore it, and curated subsets are modelled and loaded into the warehouse for reporting. The lakehouse pattern goes further and serves both kinds of work from one copy of the data on object storage.
Is a data lake the same as a database?
No. A database such as an operational SQL system stores current records for an application and enforces a schema on every write. A data lake is a store of files in many formats, usually on object storage, where structure is applied only when the data is read.
What is a data swamp?
A data swamp is a data lake that has lost its usefulness because files were added without metadata, ownership or quality checks. Users cannot find data or trust it. A catalog, clear zones and access rules prevent it.
References
- W. H. Inmon, Building the Data Warehouse, 4th ed., Wiley, 2005
- R. Kimball and M. Ross, The Data Warehouse Toolkit, 3rd ed., Wiley, 2013
- J. Reis and M. Housley, Fundamentals of Data Engineering, O'Reilly, 2022
- M. Armbrust et al., Lakehouse: A New Generation of Open Platforms that Unify Data Warehousing and Advanced Analytics, CIDR, 2021
- M. Fowler, DataLake, martinfowler.com bliki, 2015
- Apache Parquet documentation, Apache Software Foundation
Get one engineering email a week
New articles, worked examples and study notes every week. Free, no spam, unsubscribe any time.