By the last page, this is the design you will have built. Drag it, or Show all, to see every part.
Lesson · 8 pages · about 5 min
Pessimistic locking
A transaction locks the row before it checks it, so a competing writer waits; locking rows in opposite orders can deadlock, and the database breaks the cycle.