Why your database is copying everything on every write
MVCC — Multi-Version Concurrency Control — is the engine under most modern databases. PostgreSQL, MySQL 8.0+, Oracle, SQL Server, CockroachDB. It lets multiple reads and writes happen at once without blocking each other.
The trick is simple: every row in the table carries extra columns. A version number. A transaction ID. A visibility flag. When a new row gets inserted, the database doesn't touch the old one. It writes a new copy. When an old transaction still needs the previous version, it reads the old copy.
This is why your reads never block your writes.
The cost? The old versions stick around. They pile up. Tables grow. You see it in the disk usage. Your storage bill goes up. Your backups get bigger. Your queries get slower because the engine has to check version visibility on every row it touches.
PostgreSQL calls this bloat. It accumulates until you run VACUUM. VACUUM marks old versions as dead. It doesn't free the space back to the OS. It just makes it available for reuse. That's why you often run VACUUM FULL — it rewrites the whole table, drops the dead copies, and returns the space.
MySQL's InnoDB handles it differently. It uses an undo log. Old versions live there. A background purge thread cleans them up. But if your transactions are long, or your writes are heavy, that undo log grows. You see it in slow queries. You see it in lock waits.
The hard part isn't understanding the concept. It's reading your own schema and realizing every table is quietly hoarding its own history. Every INSERT. Every UPDATE. The old rows don't vanish. They wait. They wait until VACUUM or purge or autovacuum comes along.
So when you plan a migration, when you size your database, when you budget for storage — you're not just budgeting for today's data. You're budgeting for every version that's still alive.
Why this matters for us: our apps and our databases are cheap to build but expensive to maintain if we don't respect the hidden cost of every write — and that cost shows up in our bills, our slowdowns, and our midnight pages.
“Every INSERT is quietly hoarding its own history.”