ACID
4 properties of the transaction in Database.
Atomic
Every transaction should be done or never do. No mid-state.
Consistency
States should be always OK.
The data should be integrated before transaction start and after transaction end.
Isolation
The transactions should be independence.
Four levels:
- Read uncommitted: Transaction can read uncommitted data from other transaction.
- Read committed: Transaction can only read committed data from other transaction.
- Repeatable read: Same query to same result.
- Serializable: Same orders of execution of transactions will lead to same result.
Durability
Data never loss.
Example implementation: Write-ahead logging (WAL)