Multi-version concurrency control (MVCC) is an optimistic database concurrency-control technique that keeps timestamped versions of records. Transactions read a consistent snapshot based on their start time, while writes create new versions, allowing readers and writers to proceed concurrently with less lock contention. section 9.5.2 section 9.4.2
MVCC provides these operational properties and trade-offs:
- Readers see committed data available in their snapshot rather than uncommitted or later changes. section 9.4.2
- Writers create versions instead of blocking readers; conflicting transactions can be aborted to preserve consistency. section 9.5.2
- Maintaining old versions increases storage requirements and requires garbage collection. section 9.5.2
- Snapshot isolation prevents dirty and non-repeatable reads but still permits write skew, so it does not guarantee serializability. section 9.4.2
Versions within one transaction
A transaction initially stores key A as version v0 with value 1. Updating A to 2 marks v0 deleted and inserts v1; updating it again to 3 marks v1 deleted and inserts v2. The version chain represents the transaction's evolving database state. section 9.5.2
Figure 9.6 An example of multiversion concurrency control (MVCC) across two transactions. The steps are the same as in figure 9.5, but in the second transaction, we see how the database maintains multiple versions of the objects, which allows transactions to execute optimistically.
Trace two transactions through their reads, writes, and retained record versions to see how MVCC enables optimistic execution. section 9.5.2



