[go: up one dir, main page]

0% found this document useful (0 votes)
10 views9 pages

Multiversition Cuncurrency Control

Multiversion concurrency control techniques maintain multiple versions of data items to allow transactions to access older versions, thereby enhancing serializability. The document discusses timestamp ordering methods for managing these versions and outlines rules for ensuring serializability during read and write operations. Additionally, it introduces multiversion two-phase locking, which allows concurrent transactions while managing write locks effectively.

Uploaded by

nomikareddy34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

Multiversition Cuncurrency Control

Multiversion concurrency control techniques maintain multiple versions of data items to allow transactions to access older versions, thereby enhancing serializability. The document discusses timestamp ordering methods for managing these versions and outlines rules for ensuring serializability during read and write operations. Additionally, it introduces multiversion two-phase locking, which allows concurrent transactions while managing write locks effectively.

Uploaded by

nomikareddy34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Multiversion concurrency

control techniques

UNDER THE GUIDENCE OF: PRESENTED BY:


Dr. Deepika Lokesh mam Nomika. V
HOD of AIML dept AIML 'D'sec
. CBIT-Kolar 1CK22AI033
Multiversion concurrency control
Other protocols for concurrency control keep the old values of a data item when
the data is updated. These are know as Multiversion concurrency control,
because several versions (values) of an item are maintained.

• When a transaction requires access to an item, an appropriate version is


chosen to maintain the serializability of the currently executing schedule, if
possible.
• The idea is that some read operations that would be rejected in other
techniques can still be accepted by reading an older version of the item to
maintain serializability. When the transaction writes an item, it writes a new
version and the old version(s) of the item are retained.

• An obvious drawback of multiversion techniques is that more storage is need


to maintain multiple versions of the database items.
Multiversion technique Based on Timestamp Ordering

•In this method, several versions X1, X2, ..., Xk of each data item X are maintained.
• For each version, the value of version Xi and the following two timestamps are kept:
1. read_TS(Xi). The read timestamp of Xi is the largest of all the timestamps of
transactions that have successfully read version Xi.
2. write_TS(Xi). The write timestamp of Xi is the timestamp of the transaction
that wrote the value of version
• Whenever a transaction T is allowed to execute a write_item(X) operation, a new
version Xk+1 of item X is created, with both the write_TS(Xk+1) and the
read_TS(Xk+1) set to TS(T)
•Correspondingly, when a transaction T is allowed to read the value of version Xi, the
value of read_TS(Xi) is set to the larger of the current read_TS(Xi) and TS(T).
•To ensure serializability, the following rules are used:
1. If transaction T issues a write_item(X) operation, and version i of X has the
highest write_TS(Xi) of all versions of X that is also less than or equal to TS(T),
and read_TS(Xi) > TS(T), then abort and roll back transaction T; otherwise,
create a new version Xj of X with read_TS(Xj) = write_TS(Xj) = TS(T).

2. If transaction T issues a read_item(X) operation, find the version i of X that has


the highest write_TS(Xi) of all versions of X that is also less than or equal to
TS(T); then return the value of Xi to transaction T, and set the value of read_TS(
Xi) to the larger of TS(T) and the current read_TS(Xi).
Multiversion Two-Phase Locking Using Certify Locks

In this multiple-mode locking scheme, there are three locking modes for an
item: read, write, and certify
Hence, the state of LOCK(X) for an item X can be one of read-locked,
writelocked, certify-locked, or unlocked
We can describe the relationship between read and write locks in the
standard scheme by means of the lock compatibility table shown in Figure
•An entry of Yes means that if a transaction T holds the type of lock specified in
the column header on item X and if transaction T_ requests the type of lock
specified in the row header on the same item X, then T_can obtain the lock
because the locking nodes are compatible.

Fig: Lock compatibility tables. a) A compatibility table for read/write locking


scheme b) A compatibility table for read/write/certify locking scheme.
•On the other hand, an entry of No in the table indicates that the locks are not
compatible, so T must wait until T releases the lock
•The idea behind multiversion 2PL is to allow other transactions T X while a single
transaction T holds a write lock on X
•This is accomplished by allowing two versions for each item X; one version must
always have been written by some committed transaction
•The second version X is created when a transaction T acquires a write lock on the
item
THANK YOU

You might also like