liveBook · Manning

Optimistic concurrency control

As explained in Architecting an Apache Iceberg Lakehouse

A concurrency-control approach that allows operations to proceed without locks and detects conflicts when changes are committed.

Optimistic concurrency control lets writers proceed without distributed locks, then validates a proposed table update during an atomic commit. A writer publishes a new snapshot only if the table metadata remains unchanged; otherwise, the commit fails. section 6.3.2 section 7.1.1

Disjoint writes, such as appends to different partitions, can succeed concurrently. Overlapping overwrites can conflict, requiring retries, backoff, and sometimes reevaluation against the latest table state. Frequent commits also accumulate snapshots and manifests, making metadata pruning, compaction, or batching operationally important. section 6.3.2

Figure 7.3 Optimistic commits allow engines to write data and metadata and then determine whether the commit is successful by checking its place in the commit sequence in the metadata before and after writing files and committing. If the projected sequence number changes between the two checks, another transaction has occurred and this one should be retried.

The commit sequence illustrates how an engine writes data and metadata, checks the expected sequence, and retries when another transaction changes the table first. section 7.1.1

How Architecting an Apache Iceberg Lakehouse covers it

How deep it goes
Explains atomic compare-and-swap, conflict conditions, retries, and metadata tradeoffs without descending into implementation code.
Examples
Uses concurrent partition appends, overlapping overwrites, streaming micro-batches, and sequence-number checks as concrete examples.
What you can do after
Diagnose commit conflicts, configure retry and backoff behavior, and balance freshness against metadata growth.
How it connects
Connects atomic commits with table snapshots, catalogs, metadata, partitions, retries, backoff, and concurrent overwrites.

Also explained in

Compare how 3 books explain optimistic concurrency control →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting an Apache Iceberg Lakehouse. The section links point to the parts of the book it draws on.