Transactions
3 engineering logs on Transactions. Newest first.
- Optimistic vs pessimistic locking: choose by contention, not preference
Why a version column outperforms row locks until it does not, why the crossover point is measurable rather than a matter of taste, and why retrying an optimistic failure without thinking is how you lose a customer's edit.
- Deadlocks are a lock ordering bug, and lock ordering is a design decision
Why two transactions doing the same thing in a different order will eventually stop forever, why the database picking a victim is the good outcome, and why sorting your identifiers before you touch them removes an entire class of incident.
- Decoding isolation levels: I built a toy DB to force dirty reads and phantom reads
Why the ANSI isolation table does not describe your database, what a phantom read actually is at the index level, and why snapshot isolation still lets two correct transactions corrupt each other.