Part 173: Databricks & Apache Spark SQL: Delta Lake ACID & Time Travel
Bringing ACID transactions and schema enforcement to open data lakes.
1. What is Delta Lake?
Traditional cloud data lakes (raw Parquet on S3) lack ACID transactions, causing dirty reads and partial file writes. Delta Lake solves this with:
- ACID Transactions: Backed by a file-based commit log (_delta_log/).
- Schema Enforcement & Evolution: Prevents corrupted schemas from entering the lake.
- Unified Batch & Streaming: Query real-time Kafka streams and static tables using the same SQL.
2. Delta Lake SQL Syntax
-- Create an ACID Delta Lake table on cloud storage
CREATE TABLE customer_bronze (
id BIGINT,
email STRING,
created_at TIMESTAMP
) USING DELTA
LOCATION 's3://my-lakehouse/bronze/customers';
-- Standard SQL MERGE (Upsert) on Data Lake:
MERGE INTO customer_bronze AS target
USING customer_updates AS source
ON target.id = source.id
WHEN MATCHED THEN
UPDATE SET target.email = source.email
WHEN NOT MATCHED THEN
INSERT (id, email, created_at) VALUES (source.id, source.email, source.created_at);
3. Delta Time Travel
-- Query previous versions from commit log
SELECT * FROM customer_bronze VERSION AS OF 12;
SELECT * FROM customer_bronze TIMESTAMP AS OF '2026-09-01 12:00:00';
-- Restore table after an invalid batch job:
RESTORE TABLE customer_bronze TO VERSION AS OF 11;
Key Takeaways
- Delta Lake transforms raw S3/ADLS blob storage into a fully transactional relational Lakehouse.
In Part 174, we explore Advanced Aggregations: QUALIFY, ROLLUP, CUBE & GROUPING SETS!

