ContentsThe library

Doing Two Things at Once

The Promise Is Weaker Than You Think

Last timeGetting It Right Without Waiting

A transaction promises all or nothing, and that nobody sees your half-finished work. The second promise is a dial, and the default setting is not the strongest one.

A transaction is sold as the thing that makes concurrency somebody else's

problem. It is not, and the gap between what it promises and what people assume

it promises is the source of a specific family of production bugs.

There are two separate guarantees in the box.

All of it or none of it

The first is the one that works exactly as advertised. Every change inside the

transaction takes effect, or none of them does. A crash in the middle leaves no

trace of the half that had been done.

FIG 1The two ways a transaction can end
This is the guarantee that lets a transfer between two accounts be written as two changes without any mechanism for repairing half-transferred money. It is also the one people understand correctly, which is why the rest of this lesson is about the other one.

The second guarantee is a dial

The second guarantee concerns what other transactions can see while yours is

running, and it is not a fact about the database. It is a setting, with named

levels, and each level permits a specific list of anomalies.

The lesson stops here

5 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Update That Vanished
  2. 02A Door That Admits Oneopening only
  3. 03The Bill Arrives as Latencyopening only
  4. 04Everybody Holding, Nobody Movingopening only
  5. 05Try, Check, Try Againopening only
  6. 06The Promise Is Weaker Than You Thinkyou are here
  7. 07The Ceiling You Cannot Buyopening only
  8. 08The Problem You Decide Not to Haveopening only

Read alongside