# What write skew looks like

DevFeed: [What write skew looks like](<https://devfeed.tech/articles/what-write-skew-looks-like-23825.md>)

Original publisher: [Read original article](<https://cockroachlabs.com/blog/what-write-skew-looks-like>)

Author: Justin Jaffray

Published: 2022-03-31T00:00:00Z

Content type: article

Language: en

Sources: [Cockroach Labs](<https://devfeed.tech/sources/cockroach-labs.md>)

Topics: [Transactions](<https://devfeed.tech/topics/transactions.md>), [acid](<https://devfeed.tech/topics/acid.md>), [consistency](<https://devfeed.tech/topics/consistency.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [cycles](<https://devfeed.tech/tags/cycles.md>), [database](<https://devfeed.tech/tags/database.md>), [isolation](<https://devfeed.tech/tags/isolation.md>), [isolation-level](<https://devfeed.tech/tags/isolation-level.md>), [snapshot-isolation](<https://devfeed.tech/tags/snapshot-isolation.md>), [transaction](<https://devfeed.tech/tags/transaction.md>), [write-skew](<https://devfeed.tech/tags/write-skew.md>)

## AI overview

Snapshot Isolation gives each transaction a consistent read snapshot and prevents concurrent transactions from writing overlapping sets, yet it can still allow nonserializable write skew. In the example, one transaction copies x to y while another copies y to x; each reads before the other commits and writes a different location, producing a swap that no serial ordering permits. The article explains how to identify such anomalies with a serialization graph: dependencies form edges, and a cycle means the history is not serializable. Under Snapshot Isolation, any cycle contains consecutive concurrent read-write anti-dependencies. Serializable Snapshot Isolation uses this pattern to track transactions involved in anti-dependencies on both sides and abort a transaction or a neighbor, preventing cycles while sometimes aborting transactions that were not themselves part of a cycle. The article also argues that serializability simplifies invariant checking: each transaction can be checked on its own, whereas weaker isolation requires reasoning about interactions among transactions.

## Source excerpt

Syndication from What Does Write Skew Look Like by Justin Jaffray This post is about gaining intuition for Write Skew, and, by extension, Snapshot Isolation. Snapshot Isolation is billed as a transaction isolation level that offers a good mix between performance and correctness, but the precise meaning of "correctness" here is often vague. In this post I want to break down and capture exactly when the thing called "write skew" can happen.