🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Databases Advanced

What is MVCC (Multi-Version Concurrency Control)?

A technique where the database maintains multiple versions of data to allow concurrent reads and writes without locking.

MVCC enables high concurrency by letting readers see a consistent snapshot of data without blocking writers. When a row is updated, the database creates a new version rather than overwriting the old one. Readers see the version that was current when their transaction started. PostgreSQL implements MVCC by storing version information (xmin/xmax transaction IDs) with each tuple. This eliminates read-write contention but requires periodic VACUUM to reclaim space from obsolete row versions. MVCC is why PostgreSQL can handle many concurrent users efficiently.

Related Terms

Prepared Statement
A pre-compiled SQL template that uses parameters instead of literal values, preventing SQL injection and improving performance.
SQL
Structured Query Language — the standard language for managing and querying data in relational databases.
Database Constraint
Rules enforced by the database to maintain data integrity, including NOT NULL, UNIQUE, CHECK, PRIMARY KEY, and FOREIGN KEY.
JSONB
PostgreSQL's binary JSON data type that stores JSON documents with indexing, querying, and manipulation capabilities.
Normalization
The process of organizing database tables to reduce data redundancy and improve data integrity.
CTE (Common Table Expression)
A temporary named result set defined within a SQL statement using the WITH clause, improving query readability and enabling recursion.
View All Databases Terms →