Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Database Internals · One Database, to the Bolt · about 20 min to read

Play it as a journeyTutor comes with a plan

Locks, Latches & Transactions

Locks, Latches & Transactions
Locks, Latches & Transactions · Open board

The board that draws latches and locks side by side, the pair every “why is my database stuck” ticket confuses.

Before you start. The last lesson watched the database plan how to answer a query, the question your app sends it, before reading a single row (one record, such as one account). This lesson is about what happens once that plan runs and meets every other query touching the same rows at the same time.

Lesson 14 of 26 in Database Internals

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1976: a bank that was never allowed to go down
  • The fix that clicked: reserve the page, not the ledger
  • The animal nobody at the counter ever sees
  • The knot two transfers tie by themselves
  • The freeze that isn’t a freeze at all

Terms it explains: lock, latch, deadlock, Write skew, isolation level, Two-phase locking (2PL), Granularity, Escalation, Timestamp ordering, Optimistic concurrency control, microseconds, none, Strict 2PL, cycle, 1 second, victim, retry, Andy Pavlo, CMU 15-445, The Critique, discussed.

Related paper

Review Database Internals