Atomicity Consistency Isolation Durability
Atomicity
- “All or nothing”
- If any part of transaction fails , everything gets rolled back
Example: Bank transfer between 2 users at an example , if something fails every step of the transaction is rolled back
Consistency
- Transaction must follow all rules and constraints
- DBMS will return a consistency violation and cancel the transaction
Isolation
- How concurrent transactions affect consistency
- Isolation makes it seem like each transaction is the only one occurring
Different levels of Isolation (in order of allowing most consistency):
- Serialisable
- Read Committed Isolation
- Repeatable Isolation
Tradeoff → using a higher isolation means more consistent transactions, but mean less concurrent transactions
Durability
- Once committed, the transaction is permanent
- Done by write-ahead logging
- Persist changes to disk before confirming the commit
- In distributed databases this means replicating across other nodes