---
answer: direct
beat: system-design
source: 1 article · updated: September 1, 2026
---

What causes a deadlock, and how do databases resolve it?

A deadlock happens when transaction A holds a lock transaction B needs, while B holds a lock A needs — neither can proceed. Databases detect this with a wait-for graph (a cycle means deadlock) and resolve it by picking a victim transaction to abort and retry, rather than letting both wait forever.

Answered in

Database Transactions Explained: ACID, Isolation Levels, and Concurrency Control

What ACID actually guarantees, and how pessimistic vs optimistic concurrency control decide whether your app locks or retries under load.

Crashtech Editorial September 1, 2026 System Design

Read the full analysis

Other questions this article answers

More system design questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design beat.