MVCC explained in plain terms means understanding how a database lets readers and writers work at the same time without blocking each other. The central question is how a long report can read a stable set of numbers while transactions keep changing them, and the answer is versions: keep every old version of a row, and give each reader the version that was current when it started.
Multiversion concurrency control, or MVCC, is a method in which a database keeps several versions of each row, so that a reader sees the version that matches its snapshot and a writer creates a new version instead of overwriting the old one. It is the mechanism behind the snapshot isolation of PostgreSQL, MySQL, and many other databases.
The idea is simple: never overwrite in place, and readers never have to wait. This article explains what MVCC is, how it works, and where it is used.
Key takeaways
- MVCC keeps several versions of each row instead of overwriting in place.
- Readers see the version that was current when their transaction started.
- Writers create new versions, so they never block readers.
- Old versions are cleaned up once no transaction can still see them.
- It is the mechanism behind snapshot isolation in most modern databases.
What MVCC is
In a database without MVCC, a writer that changes a row locks it, and a reader that wants the row must wait for the lock. MVCC removes the wait by keeping the old version alongside the new one: the reader sees the old version, the writer works on the new one, and neither blocks the other. The old version stays readable until every transaction that could see it has finished.
Each version carries the identity of the transaction that created it and, once it is superseded, the identity of the transaction that replaced it. A reader compares those markers with its own snapshot to decide which version it may see, and the rule is simple: a version is visible if it was created by a transaction that had committed before the reader started, and not yet replaced by one that had.
The idea dates to the late 1970s, and it became the standard approach for databases that need many readers and many writers at once. PostgreSQL has used MVCC since its earliest versions, and MySQL’s InnoDB storage engine uses it for its default isolation level. Our guide to snapshot isolation explains the guarantee MVCC provides, and our guide to ACID explains the properties that guarantee belongs to.
How MVCC works
When a transaction updates a row, the database does not change the row in place. It writes a new version of the row, marks the old version as replaced, and leaves both on disk. A reader that started before the update sees the old version, while a reader that starts after it commits sees the new one.
Deleting a row works the same way. The database marks the current version as deleted by a particular transaction, but the row stays on disk until no transaction can still see it. A reader that started before the delete still sees the row, which is correct for its snapshot.
Inserting a row creates a version that is visible only to transactions that start after the insert commits. A reader that started earlier never sees the new row, so its view of the data stays stable from start to finish.
Old versions cannot live forever, so the database cleans them up in the background. PostgreSQL calls this vacuuming, and it reclaims the space of versions that no active transaction can see. If a long-running transaction holds an old snapshot open, the cleanup must wait, which is why a single idle transaction can make a database grow.
Write conflicts are still possible. If two transactions update the same row at once, the second one finds the row already changed by a transaction that has not committed, and it must wait or fail. MVCC removes the conflict between readers and writers, not the conflict between two writers.

Comparing MVCC with other concurrency controls
MVCC is one of several ways to manage concurrency, and each was built with a different emphasis. Two-phase locking blocks readers while writers work, timestamp ordering rejects operations that arrive late, and optimistic validation checks for conflicts at commit time, but each approach trades waiting for complexity in a different way.
The table below sets out the main contrasts between the leading approaches.
| Aspect | MVCC | Two-phase locking | Optimistic validation |
|---|---|---|---|
| Readers block writers | Never | Yes, while a lock is held | No, until commit |
| Writers block readers | Never | Yes, while a lock is held | No, until commit |
| Version storage | Old versions kept until unseen | None | None |
| Write conflicts | Second writer waits or fails | Deadlocks possible | Aborts on conflict |
| Best for | Read-heavy mixed workloads | Strict correctness | Low-contention workloads |
The practical result is that MVCC is the right default for systems with many readers and writers, locking suits work where correctness matters more than concurrency, and optimistic validation fits workloads where conflicts are rare.
Where MVCC is used
PostgreSQL uses MVCC for every transaction. Readers never block writers and writers never block readers, which is why a long analytical query can run alongside a busy stream of updates without either slowing the other down.
MySQL’s InnoDB engine uses MVCC for its default isolation level. A transaction that reads rows sees a consistent snapshot taken when it started, while other transactions continue to insert and update around it.
Oracle Database has used a form of MVCC since the 1980s, keeping undo data so that a query sees the data as it was when the query began, even while other sessions change it.
Distributed databases use MVCC to give readers a stable view across many machines. CockroachDB and TiDB keep versioned rows so that a distributed transaction can read a consistent snapshot without locking rows on every node.
Version control systems use the same idea for files. A commit creates a new version of the repository, and any reader can check out an old one, because the old versions are never overwritten, only superseded.
Strengths and limits
The greatest strength of MVCC is that readers never wait. A reporting query, a backup, and a live application can all read the same database at once, each seeing a consistent snapshot, and none of them slows the others down.
It is also a strength that MVCC makes snapshots cheap. A new snapshot is just a marker, not a copy of the data, so a database can offer consistent reads to any number of transactions without copying anything.
The limits are real, though. Old versions take space, and a long-running transaction can stop cleanup and make the database grow. Two writers can still conflict on the same row, and MVCC alone does not prevent write skew, which is why the strongest isolation level adds extra checks on top.
MVCC checklist
- Use MVCC-backed isolation when readers and writers share a database.
- Keep transactions short; a long one holds old versions open.
- Monitor bloat; a growing table often means cleanup is blocked.
- Watch for idle transactions holding snapshots open for hours.
- Expect write conflicts on hot rows even with MVCC in place.
- Test under concurrent load, not one transaction at a time.
- Tune the cleanup process before the database grows unmanageable.
- Remember that MVCC gives snapshot isolation, not full serializability.
- Add extra checks when write skew would be a real problem.
Frequently asked questions
What is MVCC in simple terms?
It is a way of storing several versions of each row, so readers see the version that was current when they started and writers never block them.
What does multiversion mean?
That the database keeps old versions of rows alongside new ones, instead of overwriting data in place.
Why do readers never block writers under MVCC?
Because a writer creates a new version of a row, leaving the old version in place for readers that started earlier.
What happens to old versions?
A background process reclaims them once no active transaction can still see them.
Can two writers still conflict under MVCC?
Yes. If two transactions update the same row, the second must wait or fail, because only one new version can win.
When should I not use MVCC?
When the workload is almost entirely writes to the same rows, or when the storage cost of old versions outweighs the benefit of non-blocking reads.
The bottom line
MVCC explained in one line is this: keep every version, and let each reader see the one that was current when it started.
It is the mechanism that lets a busy database serve readers and writers at once, and the reason a long report never has to wait for a single update.
This article is general information about how MVCC works, not advice about choosing concurrency control for a particular system.







