This source code is made by G02/K02 to fulfill Database Management Project Task on Concurrency Control simulation using Two Phase Locking (2PL), Optimistic Concurrency Control (OCC), and Multiversion Concurrency Control Protocol
- Author
- General Information
- Project Structure
- Requirements
- How to Run the Program
- Input Format
- Screenshots
Name | NIM |
---|---|
Muhammad Fahkry Malta | 13519032 |
Michael Leon Putra Widhi | 13521108 |
Ulung Adi Putra | 13521122 |
Nathan Tenka | 13521172 |
In the realm of database management systems (DBMS), concurrency control is a critical aspect ensuring the consistency of data in multi-user environments. Employing various protocols, such as Two-Phase Locking (2PL), Optimistic Concurrency Control (OCC), and Multi-Version Concurrency Control (MVCC), plays a pivotal role in mitigating conflicts arising from concurrent transactions. Two-Phase Locking adheres to a systematic approach where transactions acquire and release locks in two distinct phases, preventing potential data inconsistencies. Optimistic Concurrency Control, on the other hand, allows transactions to proceed concurrently without acquiring locks initially, but validates changes before committing to ensure consistency. Multi-Version Concurrency Control maintains multiple versions of a data item to enable concurrent access, providing a snapshot of the database at the time a transaction begins. These protocols collectively contribute to efficient and reliable concurrency management, facilitating seamless interaction within DBMS environments.
.
├─── doc
├─── image
├─── public
│ └─── index.html
├─── 2pl
│ ├─── test
│ │ ├─── test1.txt
│ │ ├─── test2.txt
│ │ ├─── test3.txt
│ │ └─── test4.txt
│ ├─── FileHandler.py
│ ├─── main.py
│ └─── twoPL.py
├─── mvcc
│ ├─── test
│ │ └─── test1.txt
│ ├─── FileHandler.py
│ ├─── Lib.py
│ ├─── main.py
│ └─── Mvcc.py
├─── occ
│ ├─── test
│ │ ├─── test1.txt
│ │ ├─── test2.txt
│ │ ├─── test3.txt
│ │ └─── test4.txt
│ ├─── FileHandler.py
│ ├─── Lib.py
│ ├─── main.py
│ └─── Occ.py
├─── .gitignore
└─── README.md
- Python (3.9+ would be nice)
- Do clone repository from terminal using this command
$ git clone https://github.com/mikeleo03/Database-Concurrency-Control.git
- Change directory to any concurrency control you want to run (2pl, mvcc, occ), for example
$ cd mvcc
- Prepare a .txt file containing the list of operations you want to simulate. use this input format and store it on test folder
- Run the program using this command
for example
$ python main.py test/<test_case _name>
$ python main.py test/test1.txt
DBMS operation is using following convention :
Rx(A)
stands for read operation on item data A from transaction TxWx(A)
stands for write operation on item data A from transaction TxCx
stands for commit operation from transaction Tx
By using that convention, the input will be trailing of operations separated by enter and semicolons except the last operation, for example
R1(E);
R2(G);
R1(F);
R2(F);
R1(G);
R2(E);
W1(F);
W2(E);
W1(G);
C2;
C1