Sobes.tech
Middle+

What is MVCC?

sobes.tech AI

Answer from AI

MVCC (Multi-Version Concurrency Control) is a mechanism for managing concurrent access to data in a database, allowing multiple transactions to operate in parallel without read locks.

The idea of MVCC is that when data is modified, new versions of rows are created, while old versions remain accessible to transactions that are reading them. This way, each transaction sees a consistent snapshot of the data at the moment it started, which improves performance and reduces conflicts.

Example: if one transaction updates a row, another transaction that started before this update will continue to see the old version of the row, rather than waiting for the first transaction to complete.