Correct Changes
Keep related changes consistent when requests overlap, fail or arrive more than once.
Transactions: One Change, All or Nothing
A useful business action can require several database changes. This chapter explains how to give those changes one commit boundary without pretending…
3,722 words/16 min read22Two People Change the Same Record
A program can be correct when run alone and wrong when another program changes the same facts between its steps. This chapter teaches you to write down…
4,223 words/18 min read23Isolation Levels and What You Can Observe
A transaction needs an answer to a deceptively simple question: which changes made by other transactions may it see? Isolation levels describe parts of…
3,928 words/17 min read24Locks, Deadlocks and Safe Retries
A lock is a coordination mechanism, not a synonym for failure. Waiting can be the correct way to protect a record; waiting forever or repeating the wrong…
3,821 words/17 min read25Versions, Snapshots and Optimistic Concurrency
A record can have more than one relevant version: the engine’s internal versions, a saved business revision and the copy someone is editing on a screen.…
3,895 words/17 min read26Invariants, Idempotency and the Outbox
A reliable operation must survive more than a clean first attempt. Requests can arrive twice, replies can disappear, and external delivery can fail after…
3,925 words/17 min read