IT lexicon › Infra & Ops › Database Locking

Database Locking

Infra & Ops På svenska → Updated: 2026-11-12

Mechanisms preventing data conflicts when multiple users read and write simultaneously.

Without locking, one user can read data, a second modifies it, and the first's transaction proceeds based on stale information. Lock strategies vary: read locks allow multiple readers but block writers; write locks block everything else; sophisticated schemes like MVCC (multiversion concurrency control) avoid blocking by keeping all versions available simultaneously. CODASYL systems locked at the record and set level; modern databases often use page-level or intent locking for efficiency. Locking introduces deadlock risk — processes waiting on each other in a cycle. Detection via wait-for graph is the standard remedy.

The tradeoff between consistency and concurrency has never been resolved perfectly; every system picks a point on that spectrum.

← Back to the lexicon