What is MVCC(Multi Version Concurrency Control) in PostgreSQL

Before reading this article, I would recommend you to reading article titled “Introduction to PostgreSQL and PostgreSQL Architecture“.

What is MVCC?

MVCC is the method used to ensure data consistency when multiple processes access the same table at the same time.

When multiple operations are performed on the same table, MVCC is used to protect data integrity.

With MVCC, when a transaction begins, a snapshot of the data is fetched and this value is retained until the transaction ends.

Even if the data is changed by others until the end of the transaction, the value read at the beginning of the first transaction does not change.

MVCC provides isolation between transactions. At this point, read and write operations do not affect each other.