# Database Transation
###### tags: `DBMS`
## Motivation for Conconcurrent Control in DBMS
`reference`: [here](https://www.youtube.com/watch?v=12X58NloDo0&t=755s&ab_channel=Techtud)
* Lost update
Lose update of one if the Transaction since it read the old value:

* Temporary Update
One of the Transaction fail, and roll back to original value. However, another transaction read the updated value (which is invalid), and have the following transaction based on that

* Incorrect Summary
One Transaction try to summary; however, another transaction have operation on one of the value that is being summarized, resulting wrong summary value

## Concept of Transaction
### Recovery of DBMS
The DBMS has to ensure it transaction would all or none if it fail at some point. It need to recover the original point before the transatin.
Possible Fail is as the following:

### Status of Transaction

### System Log
Need a log to record all the transaction and status (e.g. commit)
## ACID
`reference`: [here](https://www.youtube.com/watch?v=yaQ5YMWkxq4&ab_channel=theroadmap)
The four principal in DBMS could avoid above mentioned issue
### Atomicity
The transation would be complete without any interference
### Consistency
The Constraint in data field would not be compromised
### Isolation
Multiple transaction occur, each transaction would occur serial
### Durability
Once a transaction is commited, it would be in non-volatile forever