Labs
Each lab takes under an hour on a laptop and turns a claim from this mechanism into a number you measured yourself.
- 1
Conflict grows with the square of concurrency (uniform versus skewed keys)
L concurrent transactions touching k random keys out of N: conflicting pairs against L²k²/2N, uniform and Zipf-skewed.
SimulatePython with NumPy - 2
Phantoms and gap locks depend on the index
MySQL/InnoDB: SELECT ... FOR UPDATE on a price range, with and without an index on price; which inserts wait, and how many locks are held.
Real systemDocker, Python - 3
Reproduce a deadlock, then remove it by ordering locks
Two PostgreSQL sessions move money between the same two wallets in opposite orders, 20 times; then with a fixed lock order; then with deadlock_timeout = 100ms.
Break itDocker, Python - 4
One old snapshot pins the version space
Two minutes of random updates on a million-row PostgreSQL table, without and with an old Repeatable Read snapshot open: size and dead tuples.
Real systemDocker, Python - 5
Pessimistic versus optimistic crossover
16 workers doing read-modify-write on a PostgreSQL counter table of K rows, with SELECT FOR UPDATE and with a version column: throughput and goodput from K = 1,000,000 to 1.
Real systemDocker, Python - 6
Write skew under snapshot isolation, and its fix
Two on-call agents each check that two are on shift and each go off shift: REPEATABLE READ against SERIALIZABLE; then 50 clients and the retry rate.
Real systemDocker, Python - 7
The idempotency key: the unknown outcome made harmless
A top-up whose acknowledgment is lost, retried naively and with an idempotency key in SQLite; then a replay after the key has expired.
Break itPython - 8
Savepoint cliff in Postgres (more than 64 subtransactions)
A PostgreSQL transaction holding 0 to 200 subtransactions open while pgbench reads the same rows: read throughput across the 64-subtransaction cache.
Real systemDocker, Python - 9
Contended compare-and-swap: n²T/2 and the value of jitter
n writers each need one successful conditional write on a shared pointer: total time and wasted attempts with immediate retry and with jittered backoff.
SimulatePython - 10
Availability of unanimity: 0.999ⁿ versus a majority
Atomic commit needs every participant; consensus needs a majority: a^n against the binomial majority, then 10 million simulated rounds with and without rack failures.
SimulatePython with NumPy