What Write Skew Looks Like
Well written and detailed comparison of snapshot and serializable isolation levels.<p>From the article:<p><i>A more concrete reason than “nothing else makes sense” is a question of local vs. global reasoning. If a set of transactions must maintain some kind of invariant within the database (for instance, the sum of some set of fields is always greater than zero). In a database that guarantees serializability, it’s sufficient to verify that every individual transaction maintains this invariant on its own. With anything less than serializability, including Snapshot, one must consider the interactions between every transaction to ensure said invariants are upheld. This is a significant increase in the amount of work that must be done (though in reality, I think the situation is that people simply don’t do it), a point made by Alan Fekete in this talk[1] on isolation.</i><p>This bears repeating. In any non-trivial transactional application, the combination of concurrency and non-serializable transaction isolation levels is a serious bug farm. Most app&#x2F;service backends fall for this trap.<p>Unfortunately, most OLTP database systems have incredibly poor implementations of the serializable isolation level. Postgres is a notable exception, and it&#x27;s nice to see some newer database systems--like CockroachDB--making progress in this area.<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IP-S_RHlsEQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=IP-S_RHlsEQ</a> (Thanks for the link; I hadn&#x27;t seen this talk before.)