Definition
- Data lake – cheap object storage (S3, ADLS) holding raw files in formats like Parquet or ORC with schema-on-read and no built-in transactions.
- Data warehouse – a managed analytical database (Snowflake, Redshift, BigQuery) with schema-on-write, fast SQL, ACID, and strong governance.
- Lakehouse – a storage layer that adds warehouse features (ACID, schema enforcement, time travel, DML) on top of lake storage using table formats like Delta Lake, Iceberg, or Hudi.
- Table format – metadata and a transaction log layered over Parquet files that turns a folder into a real table.
- Time travel – querying a table as it was at a previous version or timestamp.
- MERGE – a DML operation that inserts new rows and updates existing ones in a single atomic operation.
The National Bank of India can store its data three ways. The data lake is a giant cheap storeroom where every raw file is dumped as-is: flexible and inexpensive, but messy and ungoverned. The data warehouse is the polished records office where only clean, filed, labelled statements live, perfect for fast trustworthy reports but pricier and stricter. The lakehouse is a clever upgrade to the cheap storeroom: you add a smart catalogue, locks, and version history so the cheap storeroom now behaves almost like the polished office. You get low cost and flexibility plus reliable transactions and clean queries in one place.
Understanding the Concepts
What is a data lake?
A data lake is built on cheap, massively scalable object storage holding raw files, typically columnar Parquet or ORC, with schema-on-read. Its strengths are cost, scale, and flexibility: you can land structured, semi-structured, and unstructured data without upfront modelling. Its weaknesses are the lack of transactions, schema enforcement, and governance.
# Reading raw Parquet from the lake
df = spark.read.parquet(
"s3://national-bank-lake/raw/txns/dt=2024-10-29/")
df.show(3)
+--------+----------+--------+-------------------+
| txn_id|account_id| amount| created_at|
+--------+----------+--------+-------------------+
| T10045| SAV2001|15000.00|2024-10-29 09:15:00|
| T10046| SAV2001| 5000.00|2024-10-29 09:17:30|
| T10047| CUR3002|250000.0|2024-10-29 09:20:00|
+--------+----------+--------+-------------------+
What is a data warehouse?
A data warehouse is a managed analytical database with schema-on-write, column-oriented storage, a query optimizer, ACID transactions, and strong governance. Its strengths are fast interactive SQL on clean modelled data, reliability, and features like fine-grained access control that regulated reporting needs.
-- Warehouse: fast, governed, schema-on-write SQL
SELECT account_id,
SUM(amount) AS total_spend,
COUNT(*) AS txn_count
FROM warehouse.fact_transactions
WHERE txn_month = '2024-10'
GROUP BY account_id
ORDER BY total_spend DESC;
account_id | total_spend | txn_count
CUR3002 | 1250000.00 | 47
SAV2001 | 450000.00 | 123
What is a lakehouse?
The lakehouse closes the gap between lake and warehouse. It uses an open table format, such as Delta Lake, Iceberg, or Hudi, layered over Parquet files on the lake, adding a transaction log that provides ACID guarantees, schema enforcement and evolution, safe concurrent reads and writes, row-level updates and deletes via MERGE, and time travel to query historical versions.
# Lakehouse: Delta Lake on S3 with ACID
df.write.format("delta").mode("append").save(
"s3://national-bank-lake/curated/txns_delta")
# MERGE: upsert new and updated records
from delta.tables import DeltaTable
target = DeltaTable.forPath(spark,
"s3://national-bank-lake/curated/txns_delta")
target.alias("t").merge(
updates.alias("u"),
"t.txn_id = u.txn_id"
).whenMatchedUpdateAll() \
.whenNotMatchedInsertAll() \
.execute()
How do the three compare?
| Aspect | Data Lake | Data Warehouse | Lakehouse |
|---|---|---|---|
| Storage | Object storage (S3) | Managed DB engine | Object storage + table format |
| Schema | Schema-on-read | Schema-on-write | Enforced + evolvable |
| ACID | No | Yes | Yes (via transaction log) |
| DML (UPDATE/DELETE) | No | Yes | Yes (MERGE) |
| Time travel | No | Some (Snowflake) | Yes (all table formats) |
| Cost per TB | Low (pennies) | High (dollars) | Low (lake storage) |
| Governance | Manual | Built-in | Growing (Unity Catalog, etc.) |
| Best for | Raw, ML, unstructured | BI, regulated reports | Unified analytics |
package com.bank.storage;
public class ThreeWayComparison {
public static void main(String[] args) {
System.out.println("Lake: cheap, flexible, no ACID");
System.out.println("Warehouse: fast SQL, governed, expensive");
System.out.println("Lakehouse: lake cost + warehouse features");
}
}
Lake: cheap, flexible, no ACID
Warehouse: fast SQL, governed, expensive
Lakehouse: lake cost + warehouse features
When do you use each?
Use a pure lake when you want the cheapest storage for vast raw or unstructured data and do not need transactions. Use a warehouse when you need fast, highly concurrent SQL for business intelligence and regulated reporting. Use a lakehouse when you want both cheap storage and reliable analytics in one place.
package com.bank.storage;
public class WhenToUse {
public static void main(String[] args) {
System.out.println("Use LAKE when:");
System.out.println(" - Cheapest storage for raw data");
System.out.println(" - ML feature inputs");
System.out.println(" - Shape not decided yet");
System.out.println();
System.out.println("Use WAREHOUSE when:");
System.out.println(" - Fast concurrent BI dashboards");
System.out.println(" - Regulated financial reports");
System.out.println(" - Strong governance required");
System.out.println();
System.out.println("Use LAKEHOUSE when:");
System.out.println(" - Avoid two systems");
System.out.println(" - Need ACID on lake storage");
System.out.println(" - Time travel for audit");
}
}
Use LAKE when:
- Cheapest storage for raw data
- ML feature inputs
- Shape not decided yet
Use WAREHOUSE when:
- Fast concurrent BI dashboards
- Regulated financial reports
- Strong governance required
Use LAKEHOUSE when:
- Avoid two systems
- Need ACID on lake storage
- Time travel for audit
What is the hybrid pattern banks use?
Many banks run a hybrid: raw data lands in the lake, a lakehouse table format curates and serves most of it, and a dedicated warehouse still backs the most latency-sensitive, high-concurrency reporting.
# Hybrid pattern at National Bank of India
Raw Zone (Lake):
s3://bank-lake/raw/txns/ (cheap, all events)
s3://bank-lake/raw/card_swipes/ (messy, unstructured)
Curated Zone (Lakehouse):
s3://bank-lake/curated/txns_delta/ (Delta, ACID, time travel)
s3://bank-lake/curated/customer_360/ (Iceberg, schema evolution)
Serving (Warehouse):
Redshift: daily_dashboard (high-concurrency BI)
Redshift: regulatory_reports (governed, audited)
package com.bank.storage;
public class HybridPattern {
public static void main(String[] args) {
System.out.println("Bank hybrid architecture:");
System.out.println(" 1. Raw -> Lake (cheap, everything)");
System.out.println(" 2. Curated -> Lakehouse (ACID, versioned)");
System.out.println(" 3. Serving -> Warehouse (fast BI)");
System.out.println();
System.out.println("Each layer serves a different need.");
System.out.println("Data flows downstream, never upstream.");
}
}
Bank hybrid architecture:
1. Raw -> Lake (cheap, everything)
2. Curated -> Lakehouse (ACID, versioned)
3. Serving -> Warehouse (fast BI)
Each layer serves a different need.
Data flows downstream, never upstream.
What are the trade-offs of a lakehouse?
The lakehouse is promising but sometimes less mature than a dedicated warehouse for the most demanding low-latency BI concurrency. Your Spark code and Delta are open and portable, but features like Photon, Unity Catalog, and managed services are platform-specific.
package com.bank.storage;
public class LakehouseTradeoffs {
public static void main(String[] args) {
System.out.println("Lakehouse advantages:");
System.out.println(" - Lake cost + warehouse reliability");
System.out.println(" - One platform for ETL + analytics + ML");
System.out.println(" - Open formats (Delta, Iceberg)");
System.out.println();
System.out.println("Lakehouse limitations:");
System.out.println(" - Less mature for high-concurrency BI");
System.out.println(" - Some features are platform-specific");
System.out.println(" - Governance still catching up");
}
}
Lakehouse advantages:
- Lake cost + warehouse reliability
- One platform for ETL + analytics + ML
- Open formats (Delta, Iceberg)
Lakehouse limitations:
- Less mature for high-concurrency BI
- Some features are platform-specific
- Governance still catching up
What are common interview follow-up questions?
- How does Delta Lake provide ACID on top of Parquet?
- What is the difference between Delta Lake and Apache Iceberg?
- How do you decide which data stays in the lake vs moves to the warehouse?
- What is time travel and when would a bank use it?
- How do you handle sensitive data (PII) across lake and warehouse?
Visual Overview
Data Lake vs Warehouse vs Lakehouse
───────────────────────────────────
┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐
│ DATA LAKE │ │ WAREHOUSE │ │ LAKEHOUSE │
│ │ │ │ │ │
│ S3 / HDFS │ │ Snowflake │ │ Parquet on S3 │
│ Raw files │ │ Redshift │ │ + Delta/Iceberg log │
│ No ACID │ │ ACID, SQL │ │ ACID + time travel │
│ Schema-read │ │ Schema-write│ │ Schema enforced │
│ Cheap │ │ Expensive │ │ Cheap + reliable │
└──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘
│ │ │
▼ ▼ ▼
ML, raw archive BI dashboards, Unified analytics,
regulated reports one platform
Hybrid Bank Architecture
────────────────────────
Sources ──▶ Lake (raw) ──▶ Lakehouse (curated) ──▶ Warehouse (serving)
│
▼
BI Dashboards
Key Takeaway
A data lake stores raw files cheaply on object storage like S3 in columnar formats with schema-on-read. Its strengths are cost, scale, and flexibility, but it has no transactions, schema enforcement, or governance. A data warehouse like Snowflake, Redshift, or BigQuery is a managed analytical database with schema-on-write, column storage, an optimizer, ACID, and strong governance, giving fast interactive SQL on clean modelled data at higher cost. A lakehouse closes the gap by using an open table format like Delta Lake, Iceberg, or Hudi over Parquet files on the lake, adding a transaction log that provides ACID, schema enforcement, time travel, and row-level DML.
Choosing between them depends on the need. Use a pure lake for the cheapest storage of raw or unstructured data where transactions are not needed. Use a warehouse for fast, highly concurrent, governed SQL on clean structured data for business intelligence and regulated reporting. Use a lakehouse when you want both cheap storage and reliable, updatable analytics in one platform without maintaining two systems.
Many banks run a hybrid where raw data lands in the lake, a lakehouse table format curates and serves most of it, and a dedicated warehouse still backs the most latency-sensitive high-concurrency reporting. This gives each layer its optimal role.
In a banking context at the National Bank of India, raw events landed cheaply in the lake even when messy, the lakehouse layer provided ACID upserts and time-travel queries directly on lake storage, and the warehouse held the most governed data for regulatory dashboards. Having all three, matched to the right job, gave the bank cheap flexibility, trustworthy reporting, and reliable updatable analytics.
Remember one sentence: the lake stores raw data cheaply, the warehouse serves clean data fast, the lakehouse combines both, and banks often run all three matched to the workload.
---