ContentsThe library

What a Transaction Promises

Your Database Is Not Using the Level You Think It Is

Last timeThe Four Things That Go Wrong

Four named levels, each forbidding a longer list of anomalies. The one you are on by default forbids the least interesting of them and permits the two that bite.

The previous lesson listed the failures. This one is the map from those

failures to the settings your database actually offers, and it ends with the

sentence most readers of this course will find uncomfortable.

The four levels

The levels form a ladder. Each one forbids everything the level below it

forbids, plus one more thing.

FIG 1What each level forbids
forbids reading uncommitforbids the same row givforbids a new row appearforbids the vanishing up
read uncommitted0000
read committed1000
repeatable read1101
serialisable1111
Read along each row to see what that level promises. The two marked cells are the whole practical content of this lesson: they are the two zeros on the row of the level you are almost certainly using, and they correspond to the two anomalies that caused three quarters of the incidents in the previous lesson. Note also that the ladder is monotone by construction, which is why it is safe to describe a level only by what it adds.

A word on the top rung. Serialisable is not defined by a longer list of

anomalies. It is defined by the standard from the second lesson: the result

must match some order in which the transactions ran one after another. That is

a stronger kind of promise, because it covers failures nobody has named yet,

including the one this course saves for lesson seven.

The lesson stops here

6 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 Power Can Fail Between Your Two Statements
  2. 02Both of Them Read 10 and Both of Them Wrote 11opening only
  3. 03Reading Something That Was Never True, and Three Relativesopening only
  4. 04Your Database Is Not Using the Level You Think It Isyou are here
  5. 05Take Them All Before You Give Any Backopening only
  6. 06Keep the Old Row and Nobody Has to Waitopening only
  7. 07Both Doctors Checked That Someone Else Was on Callopening only
  8. 08Name the Rule First, Then Pick the Weakest Level That Holds Itopening only

Read alongside