Daffodil DB and MVCC

Daffodil DB and MVCC

Multi-Version Concurrency Control (MVCC) is a complex technique for enhancing database performance in a multi-user environment. In contrast to most of other database systems that use locks for concurrency control, Daffodil DB preserves uniformity of data by using a Multi-Version model.

MVCC ensures that each transaction obtains a snapshot of data as per the last consistent state of the database. This shields the transactions from viewing inconsistent data caused by concurrent updates on the same data by other transactions.

The main difference between Multi-Version and lock models is that in MVCC, locks attained for reading data do not conflict with locks acquired for writing data and thereby providing transaction isolation for each database session.

Transaction Isolation Levels


The ANSI/ISO SQL standard characterizes four level of transaction isolation based upon three incidences that must be prevented between concurrent transactions. These undesirable incidences are:
  • Dirty/Inconsistent reads: In this, the result of a query includes data written by a concurrent uncommitted transaction.
  • Non-repeatable reads: A transaction re-reads data that has previously read and finds that data has been modified by another transaction (that is committed since the initial read).
  • Phantom read: A transaction re-executes a query, returning a set of rows that satisfy a search condition and finds that the set of rows satisfying the condition has changed due to another recently committed transaction.
The transaction isolation levels have been categorized in to four forms: