← Advanced DBMS learning pathAdvanced DBMS · Module 5 of 10
Concurrency control
Manage simultaneous transactions safely.
📖 Key ideas
- Problems: lost update, dirty read, non-repeatable read, phantom read.
- Locking: shared (read) and exclusive (write) locks.
- Two-Phase Locking (2PL) guarantees serializability.
- Timestamp ordering and MVCC are alternatives.
- SQL isolation levels: Read Uncommitted, Read Committed, Repeatable Read, Serializable.
💡 Real-life example: Locks are bathroom door signs: occupied (exclusive) or "you may peek" (shared).
Shared lockAllows concurrent reads
Exclusive lockRequired to write
2PLTwo-Phase Locking protocol
MVCCMulti-Version Concurrency Control