# Snapshot Isolation vs Serializability

DevFeed: [Snapshot Isolation vs Serializability](<https://devfeed.tech/articles/snapshot-isolation-vs-serializability-12567.md>)

Original publisher: [Read original article](<http://brooker.co.za/blog/2024/12/17/occ-and-isolation.html>)

Author: Marc Brooker

Published: 2024-12-17T00:00:00Z

Content type: article

Language: en

Sources: [Marc Brooker's](<https://devfeed.tech/sources/marc-brooker-s-blog.md>)

Topics: [Transactions](<https://devfeed.tech/topics/transactions.md>), [Database](<https://devfeed.tech/topics/database.md>), [DSQL](<https://devfeed.tech/topics/dsql.md>), [acid](<https://devfeed.tech/topics/acid.md>)

Tags: [dsql](<https://devfeed.tech/tags/dsql.md>), [isolation](<https://devfeed.tech/tags/isolation.md>), [snapshot](<https://devfeed.tech/tags/snapshot.md>), [snapshot-isolation](<https://devfeed.tech/tags/snapshot-isolation.md>), [sql](<https://devfeed.tech/tags/sql.md>), [transaction](<https://devfeed.tech/tags/transaction.md>)

## AI overview

The excerpt argues that snapshot isolation (SI) is a practical default for many OLTP workloads because it rejects overlapping writes while avoiding serializability's broader read-write conflict checks. In the example, two transactions read rows 1 and 2, then update different rows: SI can accept both commits, allowing write skew, while serializability may reject the second because its read set overlaps the first transaction's writes. The author says avoiding such anomalies under serializability can cause more aborts or blocking, making applications more sensitive to reads and concurrency. For Aurora DSQL, lowering SI to read committed reportedly does not reduce distributed coordination, since physical clocks and MVCC provide consistent snapshots; savings in local coordination and storage multiversioning were measured as minimal. The excerpt also favors optimistic concurrency control (OCC) with MVCC: backward validation can rely on committed transaction state, and coordination can be deferred until commit, which the author says helps when coordination latency is high, such as across regions.

## Source excerpt

Snapshot Isolation vs Serializability Getting into some fundamentals. In my re:Invent talk on the internals of Aurora DSQL I mentioned that I think snapshot isolation is a sweet spot in the database isolation spectrum for most kinds of applications. Today, I want to dive in a little deeper into why I think that, and some of the trade-offs of going stronger and weaker. This post is going to be a little deeper than the last few. If you're not deeply familiar with SQL's isolation levels, I recommend checking out Crooks et al's Seeing is Believing: A Client-Centric Specification of Database Isolation, Berenson et al's A Critique of ANSI SQL Isolation Levels, or Adya et al's Generalized Isolation Level Definitions. Specifically, I'm going to talk about one very specific mental model of transaction isolation: read-write conflicts, and write-write conflicts. Let's start our journey with a transaction, T1: BEGIN; SELECT amnt FROM food WHERE id = 1 OR id = 2; UPDATE food SET amnt = amnt - 1 WHERE id = 1; COMMIT; There are a few things to notice about this transaction, when run in a database system that offers interactive (i.e. back-and-forth with the client) transactions: It directly reads two rows from the database, the rows 1 and 2 from the table food. It directly writes one row in the database, the rows 1 from the table food. It starts and ends at different times: starting during BEGIN and ending during COMMIT. Depending on the way that database is implemented, it also likely reads other data (e.g. the system catalog which tells it which tables exist), and may write other data (e.g. a secondary index on the amnt column of food). The forth point here is critical in real systems, but let's ignore it for now and focus only on the first three2. Before we do that, let's introduce a second transaction, the first one's parallel universe clone, T2. We'll also assume these are the only transactions running at this time. BEGIN; SELECT amnt FROM food WHERE id = 1 OR id = 2; UPDATE f