{
  "slug": "multiversion-concurrency-control",
  "term": "Multiversion concurrency control",
  "aliases": [
    "MVCC",
    "Multi-version concurrency control"
  ],
  "definition": "Multiversion concurrency control coordinates concurrent database access by retaining data versions and selecting which version a read may observe under the transaction protocol.",
  "note": "Mechanism: Writes create versions rather than immediately making every earlier value unavailable. Visibility and conflict rules determine which versions a transaction can read and when it can commit. Multiversion algorithms can use timestamps, locks or combinations of both. [bernstein-goodman]\n\nIsolation: MVCC is not an isolation level. In PostgreSQL 18 Read Committed, each ordinary SELECT takes a fresh statement snapshot and sees its own earlier writes. Repeatable Read uses the snapshot established by its first non-transaction-control statement and also sees its own earlier writes. That Repeatable Read mode uses snapshot isolation and can permit serialization anomalies; Serializable adds dependency checks. These are engine-specific rules. [postgres-isolation]\n\nRetention: Old row versions consume space while transactions can still need them. PostgreSQL VACUUM reclaims eligible dead-version space for reuse; ordinary VACUUM generally does not shrink the file. Version retention for concurrency does not promise an archive or backup. [postgres-vacuum]\n\nPersistence: Visibility and durable acknowledgement are separate contracts. PostgreSQL asynchronous commit can return success before the transaction's WAL reaches persistent storage, so recent acknowledged changes may be lost after a crash. [postgres-async]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Multiversion does not require unlimited history: section 5 describes particular algorithms using at most two versions per item, not PostgreSQL's version-retention policy.",
      "citationIds": [
        "bernstein-goodman"
      ]
    },
    {
      "text": "MVCC does not remove every lock: ordinary PostgreSQL SELECT takes ACCESS SHARE, which conflicts with ACCESS EXCLUSIVE, and competing writers can wait.",
      "citationIds": [
        "postgres-locking"
      ]
    }
  ],
  "related": [
    "snapshot-isolation",
    "serializable-snapshot-isolation",
    "read-committed-isolation",
    "repeatable-read-isolation"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-15",
  "citations": [
    {
      "id": "bernstein-goodman",
      "title": "Bernstein and Goodman. Multiversion Concurrency Control: Theory and Algorithms. ACM TODS 8(4), 465-483 (1983), sections 1 and 4-6.",
      "url": "https://www.cs.cmu.edu/~15712/papers/bernstein83.pdf",
      "accessed": "2026-11-15"
    },
    {
      "id": "postgres-isolation",
      "title": "PostgreSQL 18: Transaction Isolation, sections 13.2.1-13.2.3.",
      "url": "https://www.postgresql.org/docs/18/transaction-iso.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "postgres-vacuum",
      "title": "PostgreSQL 18: Routine Vacuuming, section 24.1.2, Recovering Disk Space.",
      "url": "https://www.postgresql.org/docs/18/routine-vacuuming.html#VACUUM-FOR-SPACE-RECOVERY",
      "accessed": "2026-11-15"
    },
    {
      "id": "postgres-async",
      "title": "PostgreSQL 18: Asynchronous Commit, section 28.4.",
      "url": "https://www.postgresql.org/docs/18/wal-async-commit.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "postgres-locking",
      "title": "PostgreSQL 18: Explicit Locking, sections 13.3.1-13.3.2.",
      "url": "https://www.postgresql.org/docs/18/explicit-locking.html",
      "accessed": "2026-11-15"
    },
    {
      "id": "hesela-consistency",
      "title": "Hesela: Storage consistency, transaction boundaries and durable acknowledgement.",
      "url": "https://hesela.com/analyses/storage-consistency-ordering/",
      "accessed": "2026-11-15"
    }
  ],
  "provenance": [
    "Primary-source synthesis, not a new engine execution, crash experiment or performance comparison.",
    "The 1983 paper analyzes serializable algorithms and earlier work; its date is not an invention claim. PostgreSQL 18 behavior is not a universal MVCC implementation contract."
  ]
}
