liveBook · Manning

Serializability

As explained in The Coder Cafe

Serializability is an isolation guarantee under which the outcome of concurrent transactions is equivalent to an execution in some sequential order.

Serializability is an isolation guarantee: concurrent transactions produce a result equivalent to executing those transactions in some sequential order. They need not actually run one at a time. Serializability is the strongest isolation level and expresses the isolation part of ACID. section 6.9.9 section 6.1.1

Concurrent inventory changes

Suppose one employee adds 100 units to an inventory record while another deducts 50. The transactions overlap, but a serializable outcome must be equivalent to completing one transaction before the other. A weaker isolation level may allow a transaction to observe an uncommitted change that is later abandoned. section 6.8 section 6.9.9

Serializability also prevents phantom reads. If a transaction queries a set of rows twice, another transaction must not make its observed result inconsistent with a sequential execution by changing which rows match. More broadly, serializability prevents the isolation anomalies that weaker levels may permit, including dirty reads, lost updates, and write skew. section 6.9.9 section 6.15

The guarantee has a cost: stronger isolation can introduce delays and reduce throughput, so the appropriate level depends on the application's integrity and performance needs. Do not confuse serializability with strict serializability; the latter also respects real-time ordering by combining serializability with linearizability. section 6.8 section 6.9.9

How The Coder Cafe covers it

How deep it goes
Defines equivalence to sequential execution and explains phantom-read prevention without describing an implementation.
Examples
Uses simultaneous inventory updates and changing query result sets to illustrate isolation risks.
What you can do after
Evaluate/understand it when choosing an isolation level against data-integrity, latency, and throughput needs.
How it connects
Connects serializability to ACID isolation, phantom reads, isolation anomalies, and strict serializability.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Coder Cafe. The section links point to the parts of the book it draws on.