Module 2: Delta Lake

Two teams wrote to the same Parquet directory and corrupted your turbine data. How do you make storage reliable?

in-progress

Your sensor-analytics system writes raw Parquet files to disk. That works when one process writes and one person reads. Now imagine the wind utility version: a SCADA ingestion pipeline writes turbine telemetry every 10 minutes. A separate pipeline appends weather data hourly. An ETL job backfills corrected readings from field calibrations. And 15 analysts query the same directory throughout the day.

What goes wrong?

A writer crashes halfway through a batch — you get partial files that silently corrupt downstream aggregates. Two pipelines write at the same time — one overwrites the other’s files. An analyst queries during a write and gets inconsistent results. A field engineer accidentally deletes last month’s vibration data. Nobody notices until the quarterly compliance report doesn’t add up.

These aren’t edge cases. They’re Tuesday.

Delta Lake solves this by putting a transaction log on top of Parquet files — turning a pile of files into a proper table with ACID guarantees, schema enforcement, and time travel. This module makes that concrete: you’ll read the actual _delta_log/ JSON files, trigger a schema enforcement error, and travel back in time to recover deleted data.

You’ll also understand how Delta compares to Apache Iceberg — particularly relevant since Databricks acquired Tabular (the company behind Iceberg) in 2024 and is working toward format interoperability through Delta Lake UniForm.

Prerequisites #

Complete Module 1: Why Spark Exists.

Exercises #

Exercises live in modules/02-delta-lake/exercises/. You’ll write sensor data to Delta format, inspect the transaction log, and see ACID guarantees in action.

Lectures

  1. What goes wrong when you store data as raw files? — The real-world failures that happen when multiple pipelines write Parquet files to the same directory — and why 'just use Parquet' stops working in production
  2. How Delta Lake's transaction log actually works — Walk through the _delta_log/ directory: what the JSON files contain, how a reader assembles the current table state, and why this gives you ACID on top of cloud storage
  3. Schema enforcement, time travel, and MERGE — The three Delta Lake features you'll use most in production — preventing bad writes, recovering from mistakes, and handling late-arriving data
  4. Delta Lake vs Apache Iceberg: the format landscape — An honest comparison of the two dominant open table formats — when Delta wins, when Iceberg wins, and why the distinction is blurring

Exercises

  • Exercises: Delta Lake — Write sensor data to Delta format, inspect the transaction log, and see ACID guarantees in action — locally, without Databricks

Knowledge Tests