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 · Data Systems · Data on one machine · about 17 min to read

Play it as a journeyTutor comes with a plan

Transactions

Transactions
Transactions · Open board

Data Systems track.

This lesson is about what happens when two things touch the same row, or the same rule, at once, and why the fix that catches all of it is expensive on purpose.

Before you start. The previous lesson, Encoding and Schema Change, turned a record into bytes in an agreed format, so two programs changing independently could still read each other’s data. Here everything stays on one machine. You only need to read a row of a table and picture two people reading the same one at once.

Lesson 12 of 24 in Data Systems

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

  • 1970s, San Jose: a transfer that dies half done
  • 1981: Jim Gray names the transaction
  • 1983: four letters, and the one that is hard
  • Two ATMs, one balance: the lost update
  • Two doctors, zero on call: write skew
  • The lost update, reproduced
  • Write skew, reproduced
  • Serializability, three ways

Terms it explains: transaction, atomicity, isolation, lost update, write skew, snapshot isolation, Repeatable read, MVCC, read committed, Serializable, Actual serial execution, Two-phase locking (2PL), Serializable Snapshot Isolation (SSI), abort, ACID, BASE, compare-and-set (CAS), deadlock, dirty read/write, phantom, predicate lock, read skew, serial execution / 2PL / SSI, serializability.

Lab

Two doctors each check that someone else is on call, both go off call, and both commit. Which level notices?

Pick You see the database as it was when you began, press Play next operation to the end, and watch races permitted.

Open Isolation levels

Related papers

Review Data Systems