# Lakehouse Tables with Delta Lake

> Add ACID transactions, schema enforcement, time travel and MERGE to files in object storage with Delta Lake, the table format behind Databricks. Free notes,...

Canonical: https://www.internhack.in/roadmaps/tracks/data-engineer/delta-lake
Last updated: 2026-11-28

Add ACID transactions, schema enforcement, time travel and MERGE to files in object storage with Delta Lake, the table format behind Databricks.

Intermediate · about 6 hours · difficulty 3/5

Learn first: [PySpark DataFrames](https://www.internhack.in/roadmaps/tracks/data-engineer/pyspark-dataframes), [How Cloud Data Warehouses Work](https://www.internhack.in/roadmaps/tracks/data-engineer/warehouse-concepts)

Plain Parquet files in a lake cannot be updated safely: two jobs writing at once, or a job failing halfway, leave the data broken. **Open table formats** fix this, turning a folder of files into a real table. Delta Lake is the most common one in Spark-heavy and Databricks shops.

### How it works

- Data stays as Parquet files.
- A **transaction log** (`_delta_log`) records every commit: which files were added or removed.
- Readers see a consistent **snapshot**; writers use optimistic concurrency.

### What you get

- **ACID transactions** on object storage.
- **Schema enforcement and evolution**: bad writes are rejected; new columns can be added deliberately.
- **MERGE, UPDATE, DELETE**: upserts and GDPR or DPDP deletion requests become possible.
- **Time travel**: query `VERSION AS OF` or `TIMESTAMP AS OF`.
- **Change data feed** to read row-level changes downstream.

### Maintenance

- `OPTIMIZE` compacts small files; **Z-ordering** or **liquid clustering** co-locates related data.
- `VACUUM` removes old files no longer referenced (this limits how far back time travel works).

### Using it

Works with open source Spark (`delta-spark`), Databricks, and readers like DuckDB and Polars via delta-rs. The **medallion architecture** is usually implemented as Delta tables.

### Pitfalls

- Running VACUUM with a very short retention and breaking long-running readers or time travel.
- Streaming jobs creating thousands of small files without regular OPTIMIZE.

You are ready to move on when you can create a Delta table with PySpark, MERGE daily updates into it, query an older version, and compact it with OPTIMIZE.

## Key concepts

- **Transaction log**
- **ACID on object storage**
- **Schema enforcement and evolution**
- **MERGE, UPDATE, DELETE**
- **Time travel**
- **OPTIMIZE and Z-order**
- **VACUUM and retention**
- **Change data feed**

## Other options for this step

- [Lakehouse Tables with Apache Iceberg](https://www.internhack.in/roadmaps/tracks/data-engineer/iceberg): Use Apache Iceberg, the engine-neutral open table format, for snapshots, hidden partitioning, partition evolution and multi-engine access.

## Mini project

Build a bronze, silver, gold pipeline with PySpark and Delta Lake on your laptop: append raw orders to bronze, MERGE deduplicated records into silver, aggregate into gold. Demonstrate time travel to a previous version.

## Check yourself

Two jobs write to the same plain Parquet folder at once and one fails halfway. What can readers see, and how does Delta's transaction log prevent it?

## Free resources

- [Delta Lake documentation](https://docs.delta.io/) (Delta Lake)
- [Medallion architecture](https://www.databricks.com/glossary/medallion-architecture) (Databricks)
- [Databricks documentation](https://docs.databricks.com/) (Databricks)

Previous: [Amazon Redshift](https://www.internhack.in/roadmaps/tracks/data-engineer/redshift) · Next: [Lakehouse Tables with Apache Iceberg](https://www.internhack.in/roadmaps/tracks/data-engineer/iceberg)

## More in Cloud Warehouses and Lakehouses

- [How Cloud Data Warehouses Work](https://www.internhack.in/roadmaps/tracks/data-engineer/warehouse-concepts)
- [Snowflake](https://www.internhack.in/roadmaps/tracks/data-engineer/snowflake)
- [Google BigQuery](https://www.internhack.in/roadmaps/tracks/data-engineer/bigquery)
- [Amazon Redshift](https://www.internhack.in/roadmaps/tracks/data-engineer/redshift)
- [Lakehouse Tables with Delta Lake](https://www.internhack.in/roadmaps/tracks/data-engineer/delta-lake)
- [Lakehouse Tables with Apache Iceberg](https://www.internhack.in/roadmaps/tracks/data-engineer/iceberg)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Data Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/data-engineer)
