# Snapshot Isolation

+ A transaction can only see other transaction that were committed before its start time


![left](./student-guide/diagram/11-Snapshot-Isolation-01-01.png)
------------------------------------------------------------
Snapshot Isolation

The four transaction isolation levels defined in earlier SQL standards only apply to lock-based transaction concurrency control.

In 1995, Hal Berenson et al., published the paper “A Critique of ANSI SQL Isolation Levels” and proposed the concept of Snapshot Isolation. This isolation level has no dirty reads, Non-Repeatable Read, narrow phantom read (A3), but it does not prevent phantom read in the broad sense (P3), does not block read operations, and SI also has write skew, and ANSI repeatable isolation levels do not have write skew, and phantom reads occur. Snapshot Isolation is a great choice for applications that read more and write less.

At the Snapshot Isolation transaction isolation level, what is actually specified is the visible rows between transactions. For Snapshot Isolation: A transaction can only see other transaction committed earlier than its start time.
For example, the white box represents the start time of the transaction, and the gray box represents the end time of the transaction. Each transaction read a snapshot of the transaction start time, because the transaction start time is stable, so the version of data seen by the transaction is stable. Transaction 2 starts before the end time of Transaction 1, so Transaction 2 does not see the modify of Transaction 1, and Transaction 3 starts after Transaction 1 and Practice 2 are committed, so Transaction 3 can see the modify of Transaction 1 and Transaction 2.

In terms of writes, if transaction 1 and transaction 2 have data coincident write operations, it will lead to write conflicts, and at least one transaction will be rolled back. At the isolation level of SI, handling write conflicts is relatively simple.

