Lesson 02.5
MVCC & isolation levels
Multi-version concurrency control keeps multiple versions of data so transactions can read consistent snapshots while isolation levels decide which changes they may observe.
A report that disagrees with itself
At closing time, Ava makes the shop's stock report on the computer. The report shows how many cookies are left twice: in the summary at the top and in the total at the bottom. The two numbers should match.
Meanwhile Ben sells one more cookie 🍪, so the number of cookies left changes from 5 to 4. What if that happens while Ava is still making the report?
In this lesson you'll
- 1Watch Ava make the report when Ben sells after she's done.
- 2Guess what the report says when Ben sells in the middle.
- 3Find a way to keep Ava's two numbers matching.