MVCC
ELI5 — The Vibe Check
MVCC (Multi-Version Concurrency Control) is how databases let multiple users read and write at the same time without stepping on each other's toes. Instead of locking rows, the database keeps multiple versions of each row. Your transaction sees a consistent snapshot even while others are making changes. It's like everyone having their own copy of the document.
Real Talk
Multi-Version Concurrency Control (MVCC) maintains multiple versions of data rows to allow concurrent transactions without read-write conflicts. Each transaction sees a consistent snapshot of the data at its start time. PostgreSQL implements MVCC using hidden xmin/xmax columns that track row creation and deletion transaction IDs. Dead tuples require periodic vacuuming.
When You'll Hear This
"MVCC is why readers never block writers in PostgreSQL." / "MVCC creates dead tuples that VACUUM needs to clean up."
Related Terms
Read Committed
Read Committed is the default isolation level in PostgreSQL.
Serializable Isolation
Serializable isolation is the strictest mode where the database pretends all transactions run one after another, even though they're actually concurrent.
Snapshot Isolation
Snapshot isolation gives each transaction a frozen-in-time photo of the database.
Write-Ahead Log
The Write-Ahead Log (WAL) is the database's diary. Before changing any actual data, the database first writes what it's about to do in this log.