Semicolony ELI5 · comic

Isolation levels.

A dial that trades how much overlapping transactions can see of each other for how fast they run.

  1. 1

    Two people edit the same document at once. The database has to decide how much each sees of the other’s half-typed work.

  2. Wait, where did that line go?
    unsaved draft read it, then it vanished
    2

    Loosest setting: you read a sentence the other person hasn’t saved — then they delete it. That’s a dirty read.

  3. only saved work shows
    3

    Turn the dial up to read committed: you only ever see saved work, never anyone’s drafts.

  4. pinned line re-read, same answer
    4

    Higher still — repeatable read: a line you’ve read stays put for the rest of your turn, even if someone edits it.

  5. That paragraph wasn’t there a second ago.
    new line! ? a phantom appears
    5

    But brand-new lines can still appear between two reads of the same section. Those are phantoms.

  6. waits one at a time — spotless
    6

    Top of the dial — serializable: it acts as if you each took the whole document in turn. Spotless, but everyone waits more.

A dial on a shared document: loose and fast at the bottom, strict and safe at the top.
Semicolony semicolony.dev/eli5/isolation-levels/comic
← All ELI5 explainers