CS609 – Database Systems
Assignment 2 - Concurrency Control
Fall 2016
 
 

Due Date:  9/25  email program to vrbsky@cs.ua.edu by midnight
Mode: Individual

Suppose you are working for a company that offers NoSQL and semi-relational database products.  Your manager wants you to test some schedules using multiversion concurrency control and Strong Strict 2PL with Wound-Wait.  You have been asked to implement both of these concurrency control strategies to determine the resulting schedules and the number of transaction restarts.  You will also need to keep track of the number of versions created for MVCC.   You may use any programming language of your choice (but I have to be able to test it on my desktop).

Input:  The input will be some schedule in the following format:

  S1;R1(X);W1(X);S2;R2(X);S3;R3(Y);W3(X);W3(Y);W2(X);S4;W4(X);;

where S1 indicates Start Transaction 1, R1(X) indicates Transaction 1 reads data item X and W1(X) Transaction 1 writes to data item X.  The ;; indicates the end of the schedule.  Assume the input will contain more than one schedule and the maximum number of schedules is 6.  The maximum number of different data items in the database is 4.  The maximum number of different transactions per schedule is 5, and  the maximum number of operations per transaction in one schedule is 20. The schedules to be tested MUST be input from a file called schedule.txt or allow the user to input all the schedules at once using an interface.

Assume that:  1) All input is valid  2) All transactions are single digit  3) All data elements are single character  4) There is no whitespace.

Assign a timestamp to each transaction when it enters the system, i.e. when it starts.  Do not assume transactions will start in the same order as their T#s. All transactions aborted should execute serially at the end after all other transactions in the schedule have finished. Assume all transactions are committed at the end of a schedule.

Output:   

For MVCC:  Print the schedule indicating when a transaction starts, when each R/W operation is to occur - including the version read from, the version written to, and also indicate when a new version is created, and the commit at the end.  You should indicate when a transaction must be aborted. 

Sample output: it doesn't have to be exact, but something similar would help me grade:
S6 R6(X, V0) S7 R7(Y, V0) W7(Y, V1 from V0) R6(Y, V0) S8 R8(X, V0) S9 R9(Y, V1) W9(Y, V2 from V1) R8(Y, V1) A8 C6 C7 C9 S8 R8(X) R8(Y) W8(Y) C8

 For Strong Strict 2PL with Wound-Wait:  Print the schedule indicating when a transaction starts, when each R/W operation is to occur and the commit at the end. You should indicate when a transaction must be blocked and when it is aborted. 

 Sample output: just list all the operations like we do in class, e.g.,
S6  R6(X) S7 R7(Y) W7(Y) A7 R6(Y) S8 B8 C6 R8(Y) W8(Y) R8(Z) C8 S7 R7(Y) W7(Y) C7

Also, once all schedules are processed, print summary information for the schedules listing the number of restarts for MVCC and the number of versions created for MVCC, and the number of restarts for 2PL.

You should e-mail your program to (vrbsky@cs.ua.edu).   I will test your program using my own data.