Before we demonstrate Isolation levels, we must define transactions and what ACID model is. Isolation levels are one of ACID model properties, Isolation.
A Transaction represents a collection of operations executed sequentially as one single operation. Consider the well know example of money transfer between two bank accounts of Alice and Bon. Money transfer involves the following operations:
- Read Alice’s account, by issuing a select statement, to check if Alice has X-amount or more for the transfer.
- Read Bob’s account, by issuing a select statement, to check if Bob’s account can receive money.
- Decrease Alice’s account by X-amount of money.
- Increase Bob’s account by X-amount of money.
In RDBMS for a unit of work to qualify as transaction it must comply to ACID model. So, what is ACID model ?