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.
| forbids reading uncommitted data | forbids the same row giving two answers | forbids a new row appearing | forbids the vanishing update | |
|---|---|---|---|---|
| read uncommitted | 0 | 0 | 0 | 0 |
| read committed | 1 | 0 | 0 | 0 |
| repeatable read | 1 | 1 | 0 | 1 |
| serialisable | 1 | 1 | 1 | 1 |
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 contentsThis 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