CSE Roadmap

Core tier · about 2 hours · 5 parts

Part 2 of 5 · 1 min read

Start from the bug, not from the strongest guarantee

Naming the specific anomaly a feature is vulnerable to points directly at the minimum isolation level that prevents it.

Think of a doctor prescribing the specific medicine that treats a diagnosed condition, rather than prescribing the strongest medicine available regardless of what was actually diagnosed.

In plain words: choosing an isolation level starts with identifying which specific anomaly, dirty read, non-repeatable read, phantom, or write skew, covered across this level, a particular piece of application logic is actually vulnerable to. A simple read-only report that just needs a consistent view for its own duration is vulnerable to very different anomalies than a transaction that reads several rows to decide whether some cross-row invariant still holds before writing. Naming the specific anomaly first, then picking the isolation level proven to prevent it, from the isolation-levels page's exact mapping, replaces guesswork with a direct, traceable decision.

A worked example. A feature transferring money between two accounts, which checks a balance before debiting it, is vulnerable to write skew if run under plain snapshot isolation, pointing directly at either serializable isolation or an explicit application-level check as the needed fix.

The key lines. No new SQL; this is a diagnostic process applied before choosing which isolation level a transaction should request.

Anomaly-first isolation choice

The anomaly-first isolation choice approach identifies the specific anomaly a piece of logic is vulnerable to before selecting an isolation level, rather than defaulting to the strictest level available regardless of actual need.

Example: prescribing the medicine that treats a diagnosed condition, rather than always reaching for the strongest medicine regardless of diagnosis, mirrors choosing isolation level from the actual bug.