Snapshot Isolation prevents Read Skews


Last Updated on Feb 11, 2021

Read Skews happen because a transaction is allowed to see changes committed by other transactions, that have run in the background since the transaction started. If the transaction encloses multiple queries and they fetch different data points related to the same entity or concept, there is a risk that the data values can be skewed.

Snapshot Isolation is a common solution to this problem. The core idea with Snapshot Isolation is that each transaction reads from a consistent snapshot of the database. The transaction sees all the data that was committed in the database at the start of the transaction.

Even if the data is subsequently changed by another transaction, the transaction continues to see the old data from when it started.

Because values at the start of a transaction are preserved across the database, long-running queries (like database backups or analytics queries) can refer to a consistent data set. Applications do not have to worry about changes in the underlying data in the middle of a transaction.


© 2022 Ambitious Systems. All Rights Reserved.