Spark Lakehouse: PySpark, Delta, Iceberg & Streaming
Back to Lakehouse Formats: Delta Lake & Iceberg

Delta Lake: ACID, Time Travel & Merges

Transaction log, MERGE upserts, time travel, and OPTIMIZE/Z-order.

9 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Intro and Promise — Naveen introduces the lesson and promises a technical, under-the-hood look at how Delta Lake implements ACID.
  2. The Four ACID Properties — Atomicity, Consistency, Isolation, and Durability are each explained with a bank-transfer style analogy.
  3. Why Data Lakes Need ACID — A horror story of three concurrent ETL jobs corrupting a lake shows what breaks without transactions.
  4. Transaction Log Basics — Delta records every change in the _delta_log folder and uses periodic checkpoints to avoid replaying the whole log.
  5. Atomicity and Concurrency — The five-step write pipeline ends in an atomic log append, and racing writers are resolved by optimistic concurrency control.
  6. Consistency, Isolation, Durability — Schema and constraint validation enforce consistency, snapshot isolation keeps readers and writers independent, and durability rides on cloud storage.
  7. Append, Copy-on-Write, MERGE — Append only adds files, while update, delete, and merge rewrite affected Parquet files and log the swap in one entry.
  8. Checkpoints and Debugging — Checkpoint compaction, OPTIMIZE, VACUUM, and DESCRIBE HISTORY are presented as fixes for common table problems.
  9. Advanced Delta Features — Liquid clustering, Change Data Feed, dynamic SQL filters, Delta Sharing, and deletion vectors round out the lesson.
PDF notes

Frequently asked questions

Why is appending to a JSON file considered atomic?

Cloud object storage makes a single object PUT atomic, so the entire log entry lands or none of it does. That is why Delta commits by appending one new file rather than editing existing ones.

Do readers block writers in Delta Lake?

No. Snapshot isolation means a reader pins a version number and writers commit new versions independently, so readers never block writers and writers never block readers.

What happens if two writers try to commit the same version?

Optimistic concurrency control detects that the version number already exists and the losing writer automatically retries at the next version number. Both writes succeed, just ordered.

How far back can I time travel?

Any version still inside the retention window — 30 days by default. Once VACUUM removes the old files, those versions are no longer readable.

Where does durability come from if Parquet files can be deleted?

Cloud storage replicates objects across data centers, and the transaction log is the source of truth. Even a corrupted Parquet file can be detected because the log still references it.

What is a checkpoint actually for?

It is a Parquet snapshot of the complete table state written every 10 commits, so a query reads one checkpoint plus a few recent JSON commits instead of replaying the whole log.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.