Systems & Backend

Snapshot Isolation

Each transaction reads from a frozen snapshot of the database, so it sees a consistent world regardless of concurrent writes.

Snapshot isolation is a transaction isolation level where each transaction reads from a consistent snapshot of the database taken at its start, so it never sees another transaction’s in-progress changes. It is commonly implemented with MVCC and avoids most read anomalies without read locks.

Worked example: a report transaction started at 10:00 sees the database exactly as of 10:00 for its whole run, even as orders pour in — consistent totals, no blocking of the writers. Gotcha: snapshot isolation still allows “write skew” — two transactions each read the same snapshot and make individually-valid writes that together violate a constraint (both approve the last on-call leaving nobody) — which is why the strictest level, serializable, adds extra checks on top.