tezvyn:

Write Skew: The Phantom Anomaly of Snapshot Isolation

Source: Wikipedia: Write skewadvanced

Write skew is when two transactions read the same data, make decisions, and then update *different* data, violating a business rule. It's common in booking systems or when enforcing multi-row constraints under Snapshot Isolation.

Write skew is a database anomaly where two concurrent transactions read the same state, make decisions based on it, and then modify different data items, unknowingly violating a business rule. It's like two people seeing one spot left in a room and both letting someone in. This occurs under Snapshot Isolation when enforcing constraints across multiple rows, like in booking systems. The main footgun is assuming Snapshot Isolation is truly 'isolated' or serializable; it allows these logical conflicts that simple row locking misses.

Read the original → Wikipedia: Write skew

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Write Skew: The Phantom Anomaly of Snapshot Isolation · Tezvyn