databases
10 minDatabase Locks and Isolation: Diagnose Blocking, Deadlocks, and Retries
Understand transaction conflicts, lock waits, isolation anomalies, and safe retry boundaries across relational databases.
Loading page...
databases
10 minUnderstand transaction conflicts, lock waits, isolation anomalies, and safe retry boundaries across relational databases.
databases
10 minLearn tables, keys, constraints, joins, transactions, and query shape before choosing a specific database engine.
databases
19 minReason about isolation anomalies, query-plan mistakes, B-tree/LSM trade-offs, shard routing, and production-safe index changes.
Q&A
Q&AFunctions typically return values; procedures are invoked as operations, with engine-specific transaction rules.
A function is commonly used as an expression or query result and returns a value or table. A procedure is invoked to perform an operation and may accept output parameters. Triggers run implicitly. Transaction control differs by engine, so keep commit ownership explicit and test routines against the target database/version.
databases
10 minA systematic approach to diagnosing ORM query explosions and slow database plans without guessing at indexes.
Q&A
Q&ARetry the whole idempotent transaction within a bounded policy, not just an arbitrary statement.
A deadlock detector aborts one transaction so another can progress. Capture lock and query evidence, then retry the whole business transaction only if its effects are safe to repeat. Use bounded attempts with jitter, consistent resource ordering, and idempotency for any external side effects.
Q&A
Q&AThe statement has side effects that are not visible at its call site.
A trigger can modify other rows or tables implicitly during an insert or update. That makes the visible application statement an incomplete description of the transaction and can add locking or recursion. Document and test trigger effects, or move orchestration to an explicit routine/service when hidden behavior harms operability.
databases
9 minCompare database routines and triggers with application services, focusing on transaction ownership, portability, and operational visibility.