Home

MVCC

Multi-Version Concurrency Control (MVCC) is a database concurrency control method that tracks multiple versions of data items to improve concurrent access. By allowing readers to access data without blocking writers, MVCC provides non-conflicting reads and reduces lock contention. It is widely used in relational databases and some key-value stores to support higher throughput and consistent reads across transactions.

How it works: When a transaction modifies data, a new version of the affected row is created

Cleanup and isolation: Versions that are no longer visible to any active transaction become candidates for

Applications and examples: PostgreSQL uses MVCC with tuple versions and transaction IDs; MySQL InnoDB implements MVCC

and
stored
alongside
the
previous
version.
Older
versions
remain
visible
to
transactions
that
began
earlier,
while
new
versions
are
visible
to
transactions
started
after
the
change.
Each
version
carries
metadata
(for
example,
creation
and
expiration
identifiers)
that
the
database
uses
to
determine
visibility
for
a
given
transaction
snapshot.
A
transaction
reads
a
single
snapshot
of
the
database;
it
does
not
see
concurrent
changes
that
occur
after
its
start.
removal
by
a
vacuum
or
garbage-collection
process.
MVCC
supports
different
isolation
levels,
including
read
committed
and
serializable;
at
higher
isolation
levels,
the
system
may
need
to
ensure
that
the
results
are
serializable,
potentially
increasing
contention
on
write
operations.
for
row-level
locking;
Oracle
uses
a
similar
concept
in
its
multiversion
read
consistency.
MVCC
can
reduce
read
latency
and
improve
concurrency
but
increases
storage
overhead
and
complexity
in
version
cleanup
and
conflict
handling.