Unit 12 of 15 · about 4 hours · explain

Batch and stream unification, open table formats and incremental views

Streams feed tables and tables seed streams: some brokers' tiered storage already writes Iceberg tables. The metadata swap is the commit point both sides share.

You'll be able to

  • Explain batch and stream unification: replay, exactly-once output and event-time tools as the three requirements.
  • Explain open table snapshots: immutable files plus an atomic metadata-pointer swap as the commit.
  • Explain optimistic lakehouse commits and incremental views applied after a durable checkpoint.

Covers

Batch and stream unification vocabularyOpen table formats, snapshots and atomic metadataIncremental materialized views and differential dataflow
1

Read

In this order, only the parts listed

0 of 3 done

  1. Unifying batch and stream processingDDIA 2e - Chapters 11 to 13 Batch and Stream Processing

    Chapter 13, Batch and Stream Processing through Unifying batch and stream processing (pp. 544 to 546): lambda limits with the kappa approach; replay, exactly-once semantics and event-time windowing as the three requirements

  2. Snapshots, manifests and the metadata swapApache Iceberg - Table Specification

    Table specification: snapshots with manifest lists and manifests as the read path; table metadata with the atomic metadata-file swap as the commit (page read 2026-10-15)

  3. Transaction log replay and optimistic commitsDelta Lake Protocol (pinned commit)

    Transaction log with checkpoints as the reader's replay path; optimistic concurrency with conflict detection on overlapping writes

2

Focus on

  • Batch and stream share principles; the difference is bounded versus unbounded input. Unification needs replay through one engine, exactly-once output, and event-time windows.
  • An open table is a metadata pointer plus immutable files: readers resolve the pointer to a snapshot, writers stage files then swap the pointer atomically.
  • Optimistic commits let writers on disjoint partitions succeed and reject overlapping ones without locks. The check is on read-write overlap, not on wall-clock order.
  • An incremental view applies ordered changes after a durable checkpoint and ignores replays at or below it, the same boundary as CDC offset dedup.
Common mistakes · 3
  • Reading table files without the metadata pointer. Listings show staged and superseded files; only the snapshot lists the live set.
  • Assuming replay alone gives exactly-once. The atomic metadata swap plus idempotent application decides, not the replay.
  • Treating the commit drill as the full protocol. It models partition-overlap conflicts only; real tables check finer read-write predicates.
3

Try it yourself

Closed-book, before checking anything

Closed-book, commit two lakehouse writers from one base version over disjoint and then overlapping partitions and state which commit wins; then replay an ordered change stream across a checkpoint and drop the duplicates.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.What distinguishes the lambda approach from the kappa approach?Answer

    Lambda keeps separate batch and speed paths with merged serving. Kappa replays history through the stream engine, which needs replay, exactly-once output and event-time windows.

  2. 2.Two writers commit from base version 0, one over partition 1 and one over partition 2. Then a third commits from base 0 over partition 1. Which commits succeed?Answer

    The first two succeed because their partitions are disjoint. The third is rejected because partition 1 changed since its base version.

  3. 3.A view holds checkpoint 2 and receives events with sequences 1, 2 and 3. Which apply?Answer

    Only sequence 3. Events at or below the checkpoint are duplicates or late deliveries and must be ignored.

  4. 4.Why are table data files immutable while the metadata pointer moves?Answer

    Immutable files give every reader a stable snapshot. Writers never block readers; the atomic pointer swap publishes a new snapshot at once.

5

Practice

  • AlgoMaster: Coordinate Optimistic Lakehouse Commits

    commit succeeds unless a write since the base version overlaps its partitions; currentVersion counts committed versions

    The judge models partition-overlap conflicts only, on a subscription the learner owns. Predicate-level conflicts are spec reading, not drill work.

  • AlgoMaster: Maintain an Incremental Materialized View

    apply accepts only sequences above the checkpoint, adds the increment and advances it; the rest are ignored without effect

    Same scope as above: checkpoint-gated application here, real snapshot restores in the mini-project.

You're done when

You can commit overlapping writers by hand, replay a change stream across a checkpoint without double-applying, and name the metadata swap as the commit point.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 15 more in the section
  • DDIA 2e - Chapters 11 to 13 Batch and Stream ProcessingMartin Kleppmann and Chris Riccomini · primary

    Read batch processing, stream processing and the streaming-systems philosophy in order. For every guarantee, mark the source position, operator state, output effect and recovery boundary it actually covers.

  • Apache Iceberg - Table SpecificationApache Iceberg · reference

    Read the snapshot, manifest list and manifest sections for the read path, and the table metadata section for the atomic metadata-file swap that commits a snapshot.

  • Delta Lake Protocol (pinned commit)Delta Lake · reference

    Read the transaction log replay and checkpoint sections for how readers reconstruct table state, and the concurrency section for the optimistic commit rule.

Also in this section