Why architecture matters here
Isolation choices show up as subtle bugs. A booking system with SI double-books because two concurrent transactions each verified capacity from the snapshot. A financial system with RC calculates wrong totals during a batch update. Both require understanding the level to fix.
The architecture matters because the trade-offs are joint: level, throughput, and abort rate. Higher isolation means more aborts under contention. Lower isolation means more work in application code to preserve correctness.
With the pieces in mind, you can pick the level that matches invariants + workload.
The architecture: every piece explained
The top strip is the plumbing. Transaction declares read + write set. MVCC engine keeps multiple versions per row; readers see versions matching their Snapshot. Isolation level — Read Committed (RC), Repeatable Read (RR), Snapshot Isolation (SI), Serializable Snapshot Isolation (SSI), Serializable — dictates which anomalies are prevented.
The middle row is the anomaly management. Write skew is the classic SI failure: two transactions each read state and write based on it, together violating an invariant. Predicate lock catches phantoms by locking ranges instead of rows. SSI tracks read-write dependencies at runtime and aborts transactions that would form a cycle. Vacuum / GC reclaims obsolete versions.
The lower rows are ops. Deadlock detection uses wait-for graphs. Observability tracks conflict rate, long-running transactions, and vacuum lag. Ops picks isolation per workload, documents anomalies to watch, and tests.
End-to-end flow
End-to-end: an inventory system uses SSI. Two customers try to book the last seat. Both transactions run under SSI; both read count=1, both attempt to write count=0. SSI detects the read-write dependency cycle and aborts one; that customer retries and sees count=0; only one booking succeeds. Metrics show 0.6% SSI abort rate during peak — acceptable. Compare to plain SI which would have double-booked. Long-running analytical reads share the snapshot mechanism; vacuum is throttled to avoid blocking them.