Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Concurrency control (CC) - a technique to preserve database consistency in case of interleaved committed transactions.

Multi-version concurrency control (MVCC) - a family of concurrency control techniques based on writing multiple record versions (copy-on-write).

...

Assume we have 3 transactions:

T1 = r1[x] r1[z] w1[x] c1

T2 = r2[y] r2[z] w2[y] c2

T3 = w3[x] r3[y] w3[z] c3

Two possible schedules:

S1 = w3[x] r3[y] w3[z] r2[y] r2[z] w2[y] r1[x] r1[z] w1[x] c1 c2 c3

S2 = w3[x] r1[x] r3[y] r2[y] w3[z] r2[z] r1[z] w2[y] w1[x] c1 c2 c3

The S1 is obviously serial: it corresponds to execution sequence: T3, T2, T1

...

Two actions on the same data object, modified by different transactions, conflict, if at least one of them is a write. The three anomalous situations can be described in terms of when the actions of two transactions T1 and T2 conflict with each other: in a write-read (WR) conflict T2 reads a data object previously written by T1; we define read-write (RW) and write-write (WW) conflicts similarly. These conflicts cause various anomalies, like dirty reads, unrepeatable reads, lost updates, and other.

We must also take into account schedules containing aborted transactions. Such schedules can be unrecoverable: a transaction depends on a data modified by another transaction and was committed, but another transaction was aborted. For a schedule to be recoverable, it's necessary to read only committed data. Recoverable schedules also avoid cascading aborts.

Description

// Provide the design of the solution.

...