Database Challenges: Races, Locks and Transactions
By Zeeshan Adil. Break a small task queue on purpose, on real SQLite, PostgreSQL and MySQL databases. Step through two watchers claiming the same task, a crash that leaves half a change, four workers stuck behind one lock, and a watcher that dies holding its lock, then reproduce each failure in your own repository with real processes, fix it with the right database tool and prove the fix with a test and a chart from your own run. Learn each idea once, then see how each database does it and what it costs. Four challenges now, more coming. The repository needs a laptop with Node.js and Docker; on a phone, every Build chapter has a replay of a recorded run.
4 modules · 58 lessons. Open a module to see its lesson list.
01Claim a task exactly once16 lessonsView lessonsHide lessons
01.01Set the scene: two watchers, one task15 min
01.01Set the scene: two watchers, one task15 min
01.02The gap between read and write30 min
01.02The gap between read and write30 min
01.03Put the check inside the UPDATE30 min
01.03Put the check inside the UPDATE30 min
What you'll build
A public database-challenges repository where every part runs on SQLite and at least one of PostgreSQL and MySQL: the broken version shows the failure, the fixed version passes its test, and results.md and chart.svg come from your own run.