interviewpath
  • 0day streak
  • 10total XP
  • Level 1
0/6

Unit 14 · Database research · Lesson 1 of 5

Concurrency control research and isolation correctness

Concurrency-control research asks how to provide strong isolation with high throughput on modern hardware, and how to know an implementation is actually correct. This topic connects the protocol families (2PL, OCC, timestamp ordering, MVCC variants) with formal isolation definitions, the main evaluation papers and black-box anomaly testing.
About 5 hFocus mode

Step 1: Learn the ideas

  • Protocol families: 2PL variants, OCC, timestamp ordering, MVCC
  • Deadlock handling: detection, no-wait, wait-die, wound-wait
  • MVCC design decisions: version storage, ordering, garbage collection, indexes
  • Serializable snapshot isolation and the precision of conflict detection
  • Dependency-graph isolation definitions (Adya) and anomaly classes
  • Scalability bottlenecks: timestamp allocation, latches, memory allocation
  • Deterministic concurrency control (awareness)
  • Testing isolation: two-session scripts and history checkers such as Elle

Why it matters

Concurrency control is where database theory meets systems performance. Protocols are proved correct on paper, evaluated on specific hardware and workloads, and implementations still ship with isolation bugs. A research interview will test whether you can lay out the design space, read an evaluation critically and say what evidence would change your mind.

Core ideas

Families and their failure modes.

  • Two-phase locking detects conflicts when a lock is requested; contention causes waiting and deadlocks, handled by detection or by prevention policies (no-wait, wait-die, wound-wait).
  • Optimistic concurrency control (OCC) executes without locks, records read and write sets and validates at commit; contention causes late aborts that waste the whole transaction's work.
  • Timestamp ordering assigns timestamps up front and rejects operations that arrive too late; it needs a scalable timestamp source.
  • MVCC keeps versions so readers use snapshots; writers still need a protocol (MV2PL, MVOCC, MVTO), and the system pays for version storage and garbage collection.

MVCC design space. Wu et al. separate four dimensions: the concurrency protocol; version storage (append-only chains ordered oldest-to-newest or newest-to-oldest, a separate time-travel table, or deltas); garbage collection (per tuple or per transaction); and index management (indexes pointing at physical versions or at logical row IDs). Each choice moves cost between reads, updates and cleanup; their evaluation found version storage to be among the most important choices for multi-core scaling, against the usual focus on protocols.

Scaling to many cores. Yu et al. ran seven protocols in one engine on a simulated thousand-core machine and none scaled: lock thrashing and centralized deadlock detection limited the 2PL variants, timestamp allocation limited the timestamp-based schemes, and high contention raised abort rates; even the default memory allocator was an early limit that they removed with a custom per-thread allocator. The lesson for evaluation is that centralized components (timestamp counters, lock tables, allocators) can dominate, so measured performance reflects the implementation as much as the protocol.

Correctness. Serializability is defined over histories. Adya's formalism expresses isolation levels as forbidden cycles in a graph of write-write, write-read and read-write dependencies, avoiding the ambiguity of ANSI phenomena. Snapshot isolation forbids some cycles but allows those with two consecutive read-write antidependencies; SSI aborts a transaction when it sees that structure, which can abort transactions that would have been serializable. A correctness proof covers the protocol under stated assumptions, not the code. Black-box testing fills part of the gap: two-session scripts such as Hermitage, or checkers such as Jepsen's Elle, record client-observed histories and search for anomalies. Testing can find bugs but never prove their absence.

What drives results. Contention (skew and hot rows), transaction length, read/write ratio, and whether transactions are interactive or run as stored procedures change the ranking of protocols. Rules of thumb such as "OCC wins at low contention, waiting-based locking degrades more gracefully at high contention, MVCC helps long readers" are hypotheses to check against a specific setup, not results.

Common misconceptions

  • "Optimistic is always faster than pessimistic." Under high contention OCC wastes work on aborts; the crossover depends on workload and implementation.
  • "MVCC is a concurrency-control protocol." It is a storage and visibility scheme; a protocol for writers sits on top.
  • "A correctness proof means the system is correct." Proofs cover the protocol under assumptions; implementations and configurations still produce anomalies.
  • "Throughput results transfer between systems." They depend on hardware, workload parameters and implementation details such as latches and memory allocators.
  • "SSI aborts only non-serializable transactions." It is conservative and produces false positives.

How to approach it

Rebuild the families as a table: detection point, abort cause, main overhead, best and worst workloads. Read the CMU 15-721 MVCC notes and Wu et al. with the focus on experimental variables, then Yu et al. for scalability attribution and the PostgreSQL SSI paper for the engineering side of correctness. Implement or extend BusTub's MVCC project and write tests that try to provoke write skew. For interviews, prepare a five-minute answer to "how would you evaluate a new concurrency-control protocol?" naming workloads, baselines, metrics and correctness checks.

Suggested order

  1. 1Review CMU 15-445 Fall 2025 Lectures #17 to #20 (concurrency control theory, 2PL, timestamp ordering, MVCC) if any family feels shaky.
  2. 2Read the CMU 15-721 Spring 2020 notes on Multi-Version Concurrency Control (Design Decisions), then (Protocols) and (Garbage Collection).
  3. 3Read Wu et al., An Empirical Evaluation of In-Memory Multi-Version Concurrency Control, listing the workload parameters behind each conclusion.
  4. 4Read Yu et al., Staring into the Abyss, and note which bottleneck limited each protocol and why.
  5. 5Read Serializable Snapshot Isolation in PostgreSQL for how a correctness guarantee is engineered into a production system.
  6. 6Read the Critique of ANSI SQL Isolation Levels with its paper guide (it is also on the database paper route).
  7. 7Implement BusTub Project #4 (MVOCC) and run the isolation-anomaly exercise against PostgreSQL.

Step 2: Check off what you can do

Tap each one you can genuinely do or explain. Each earns 10 XP.

Step 3: Go deeper

  • CMU 15-721 Advanced Database SystemsStart here

    Carnegie Mellon University Database Group

    Section: Spring 2020 notes: Multi-Version Concurrency Control (Design Decisions)

    Lecture notes on MVCC protocols, version storage, garbage collection and index management, with the reading list for each.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • An Empirical Evaluation of In-Memory Multi-Version Concurrency ControlStart here

    PVLDB (VLDB Endowment)

    The MVCC design-space map and an evaluation that isolates each design dimension.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Staring into the Abyss: An Evaluation of Concurrency Control with One Thousand Cores

    PVLDB (VLDB Endowment)

    How classic protocols fail to scale on many cores and how to attribute bottlenecks to components.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Serializable Snapshot Isolation in PostgreSQL

    PVLDB (VLDB Endowment)

    The engineering of serializable snapshot isolation in a production system, including false positives and memory limits.

    Open(opens in a new tab)Link responded, 5 Oct 2026
  • Jepsen consistency models: serializability, snapshot isolation and weaker levels

    Jepsen

    Definitions of serializability and snapshot isolation with links to the formal literature and to anomaly classes.

    Open(opens in a new tab)Link responded, 5 Oct 2026

Step 4: Practice

Implement BusTub Project #4 and add your own tests that try to provoke write skew and lost updates. Run the PostgreSQL anomaly exercise at every isolation level and tabulate the results. Then write the evaluation critique of Wu et al.: list the workload parameters, the baselines and one regime the paper does not test, and propose an experiment for it.

Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).

Step 5: Test yourself

Answer each one out loud or on paper before you finish the lesson.

  1. Question 1Why does OCC waste more work than 2PL under high contention?
  2. Question 2What does newest-to-oldest version ordering optimize, and what does it cost?
  3. Question 3Which dependency structure does SSI detect, and why does that make it conservative?
  4. Question 4Why can a centralized timestamp counter become a bottleneck on many cores?
  5. Question 5What can a black-box history checker prove, and what can it not?
  6. Question 6How would you separate protocol cost from implementation artifacts in an experiment?

You’re done when you can

  • Fill in the protocol-family table (detection point, abort cause, overhead, best and worst workload) from memory.
  • Explain the MVCC design dimensions and one tradeoff for each in under five minutes.
  • Write a one-page critique of a concurrency-control evaluation that names its key parameters and a missing regime.
  • Construct a history that snapshot isolation allows but serializability forbids, and show the dependency cycle.

Finish the lesson

How confident do you feel?

Lesson complete!

+50 XP

Reviews will come up on the Practice tab so it sticks.

Your notes and study time

Log study time