Multi-Version Concurrency Control (MVCC)
MVCC maintains multiple versions of tuples to allow concurrent reads without locking write operations.
Isolation Note:
MagnumDB currently guarantees Read Committed isolation. Non-repeatable reads and phantom reads are possible.
MVCC Concurrent Transaction Visualizer
Isolation:Read Committed
Timeline Step:1 / 4
Transaction A (Writer)TxID: 101
BEGIN;
Allocates TxID = 101
INSERT INTO accounts VALUES (1, 500);
Creates row tuple with xmin = 101, xmax = 0. Uncommitted!
COMMIT;
Appends COMMIT record to WAL & fsyncs. Row is now visible globally!
Transaction B (Reader)TxID: 102
BEGIN;
Allocates TxID = 102
SELECT * FROM accounts WHERE id = 1;
Read Committed Guarantee: Transaction B can only view rows where
xmin has committed prior to Transaction B snapshot evaluation. Uncommitted writes from Transaction A remain isolated. Non-repeatable reads are allowed by Read Committed design scope.