DBMS & SQL · Pro · Topic 2 of 5
Concurrency Control & Locking
6 questions.
Your progress0%
- 1st Visit
- 0/6
- 2nd Visit
- 0/6
- Revise
- 0/6
Overview
When many transactions run at the same time, the DBMS must interleave their operations without producing wrong results, and concurrency control is the set of techniques that achieves this. Lock-based protocols make transactions acquire shared or exclusive locks, with two-phase locking guaranteeing serializability. Timestamp and optimistic protocols detect conflicts instead of waiting for them, and multiversion concurrency control (MVCC), used by PostgreSQL and MySQL InnoDB, lets readers work on a snapshot without blocking writers. The isolation level decides how much protection each transaction gets. Expect questions on the classic anomalies, lock compatibility, 2PL and deadlock handling.