row lock
A database lock on one row that makes other transactions wait before changing it.
In more detail
Taking a row lock on read is the pessimistic guard against lost updates. Locks are released when the transaction commits or rolls back.
Related terms
- pessimistic locking — Locking data when you read it so nobody else can change it until your transaction finishes.
- select for update — An SQL query that reads rows and locks them for the rest of the transaction.
- lock wait — Time a transaction spends waiting for another transaction to release a lock.
Taught in
- Worked Design One: Ticket Booking, Correctness First — Scalable System Design & Distributed Architecture
- Worked Design One: Scaling The Ticket Booking System — Scalable System Design & Distributed Architecture