jargon

Comparison

SerialisablevsSnapshot isolation

Serialisable

the database promises the result is as if the concurrent transactions had run one after another, and aborts one of them to keep that promise.

The strongest isolation level: the outcome is equivalent to some serial order of the transactions. It eliminates every anomaly, including write skew, which is why it is the correct answer for financial invariants. The cost is aborts under contention, so every transaction needs a retry loop, and throughput drops on hot rows.

Full entry →

Snapshot isolation

your transaction sees the database frozen as of the instant it began, no matter what commits while it runs.

A level where every read comes from a consistent point-in-time snapshot, implemented with MVCC. Readers never block writers and writers never block readers, which is why it is the workhorse of modern databases. It still allows write skew, so it is not serialisable no matter what the level is named in your engine.

Full entry →

Related comparisons