AdvancedAbout 20 min

    Isolation Levels & Anomalies

    Read the full article on Substack

    7 min read.

    Run dirty reads, read skew, lost updates and write skew between two transactions, then watch read committed, snapshot isolation and serializable stop them.

    Think of it this way: Isolation levels are like rules for a shared notebook. Read committed: you may only read pages that are finished. Snapshot isolation: you get a photocopy of the notebook when you start, so it never changes under you. Serializable: the result must look as if everyone took turns with the notebook, one at a time.

    Read uncommittedthe problem
    Txn A
    Txn B
    Rows and their versions (oldest first)
    Balance100start

    Read uncommitted: A is changing the balance while B reads it.

    1/10

    Check your understanding

    Answer from memory before you scroll back up. Pulling an idea out of your head is what makes it stay there.

    Which level stops it?

    Sort

    Sort each anomaly by the weakest isolation level that prevents it.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Read committed

    Drop items here

    Snapshot isolation

    Drop items here

    Serializable

    Drop items here
    6 pieces left to place

    Quiz

    8 questions
    Question 1 of 8
    Score: 0

    Which anomaly does read committed prevent?

    Done with this lesson?

    Sign in free to keep your progress, streak and quiz scores.

    Keep going