MVCC / Versioning Mechanisms
How each database provides read consistency, rollback, and cleanup: row-version MVCC, undo/redo logs, version stores, WAL, vacuum, or snapshot-based storage.
mvcc multiversion concurrency control row versioning read consistency version store undo log redo log wal vacuum purge
transaction concurrency mvcc rollback recovery vacuum undo redo
| Database | Status | Syntax Family | Min Version |
|---|---|---|---|
| PostgreSQL | full | heap-tuples-plus-wal | - |
| MySQL | full | innodb-undo-plus-redo | - |
| MariaDB | full | innodb-undo-plus-redo | - |
| Oracle | full | undo-segments-plus-redo | - |
| SQL Server | partial | locking-plus-row-versioning | - |
| SQLite | partial | rollback-journal-or-wal | - |
| Redshift | partial | warehouse-snapshots-plus-vacuum | - |
| DB2 | partial | locking-plus-currently-committed | - |
| Snowflake | partial | immutable-micro-partitions | - |
| BigQuery | partial | snapshot-transactions-on-versioned-columnar-storage | - |
Compare Databases
Database Details
PostgreSQL
full
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;
VACUUM accounts;- Heap tuples carry visibility metadata; UPDATE creates a new row version instead of rewriting the old one in place.
- Readers work from transaction snapshots and usually do not block writers.
- WAL is the durability and crash-recovery path; dead tuples are reclaimed later by VACUUM and autovacuum.
- Long-running transactions delay cleanup and can increase bloat, vacuum cost, and replica recovery pressure.
MySQL
full
START TRANSACTION;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;- InnoDB keeps the current version in the clustered record and reconstructs older versions through undo logs and read views.
- Redo logging provides the durability and recovery path for committed changes.
- Background purge removes history no longer needed by active transactions.
- Long-running transactions retain undo history, increase purge debt, and can degrade read performance.
MariaDB
full
START TRANSACTION;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;- For InnoDB tables, MariaDB follows the same broad model as MySQL: current rows plus undo history plus redo logging.
- Undo history chains and delete-marked rows support consistent reads and rollback.
- Purge threads remove old versions after they are no longer needed.
- This comparison is scoped to InnoDB; engine choice matters more in MariaDB than in PostgreSQL or Oracle.
Oracle
full
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;- Oracle uses multiversion read consistency built on undo data stored in undo segments or undo tablespaces.
- Readers reconstruct older versions from undo instead of blocking on active writers.
- Redo protects both data changes and undo changes, so forward recovery and rollback state are both durable.
- Undo retention sizing matters for long queries and flashback-style historical access.
SQL Server
partial
ALTER DATABASE mydb SET READ_COMMITTED_SNAPSHOT ON;
SET TRANSACTION ISOLATION LEVEL SNAPSHOT;
BEGIN TRANSACTION;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;- SQL Server runs classic lock-based concurrency by default; row-versioning isolation is opt-in.
- READ_COMMITTED_SNAPSHOT and SNAPSHOT use copy-on-write row versioning backed by a version store.
- The version store lives in tempdb; Accelerated Database Recovery adds a persistent per-database version store and shortens rollback.
- Schema changes and write conflicts still take locks even with row versioning on.
SQLite
partial
PRAGMA journal_mode = WAL;
BEGIN IMMEDIATE;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK;- SQLite does not implement multi-writer row-version MVCC like PostgreSQL or InnoDB.
- Rollback-journal mode writes directly to the database file and uses a journal for atomicity and rollback.
- WAL mode gives readers snapshot isolation while still serializing writes to a single writer.
- Long-lived readers can delay checkpoints and WAL truncation.
Redshift
partial
BEGIN;
DELETE FROM fact_events WHERE event_date < '2025-01-01';
ROLLBACK;
VACUUM;- Redshift exposes transaction snapshots and serializable-style guarantees, but its storage behavior is closer to a columnar warehouse than a classic OLTP MVCC engine.
- Deletes mark rows for deletion; cleanup and resorting happen later through background work and VACUUM.
- The default SNAPSHOT isolation level favors throughput over stricter SERIALIZABLE behavior.
- Heavy update and delete workloads create maintenance debt and can slow both DML and vacuum work.
DB2
partial
SELECT balance FROM accounts WHERE id = 1 WITH CS;
ROLLBACK;- Concurrency is lock-based, but the currently-committed semantics let readers see the last committed version without blocking on active writers for most read paths.
- This behavior is reconstructed from log information rather than from an always-visible heap-version chain model.
- The transaction log remains central for commit, rollback, and recovery.
- Behavior is more conditional than in PostgreSQL, Oracle, or InnoDB-style engines.
Snowflake
partial
BEGIN;
UPDATE dim_customer SET segment = 'vip' WHERE customer_id = 42;
ROLLBACK;- Snowflake is not a classic row-store MVCC engine; it uses immutable columnar micro-partitions and transaction snapshots.
- DML creates new micro-partition state instead of updating blocks in place.
- Historical states are retained through Time Travel and later Fail-safe.
- High-churn tables can accumulate more retained storage because updates rewrite affected partition state.
BigQuery
partial
BEGIN TRANSACTION;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
ROLLBACK TRANSACTION;- BigQuery is not a classic OLTP MVCC engine; it offers snapshot-isolated multi-statement transactions on top of versioned columnar storage blocks.
- Modifying data creates new versions of affected storage blocks rather than updating rows in place.
- Readers and appends can proceed, but conflicting mutating operations on the same table are canceled or queued.
- Time travel provides the historical-access and recovery story rather than user-visible undo logs.
Docs: Transactions, Time Travel