Snapshot Isolation
Snapshot isolation is a guarantee that all reads made in a transaction will see a consistent snapshot of the database. In practice, queries receive the last committed values of objects that existed at the time the transaction started.
As an extension, the transaction itself will successfully commit only if its changes do not conflict with any concurrent updates made since it started (since the snapshot was taken).
Snapshot isolation is a popular feature among databases. It is supported by PostgreSQL, MySQL with the InnoDB storage engine, Oracle, SQL Server, and many others.
Implementations of Snapshot Isolation typically use write locks to prevent Dirty Writes. A transaction writing to an object that has been changed by another in-progress transaction is blocked and will have to wait until the other transaction commits or aborts.
Related:
- Snapshot Isolation prevents Read Skews
- Multi-version Concurrency Control
- Reads don't need locks in Snapshot Isolation mode
- Read committed and Snapshot isolations do not prevent Lost Updates
- Databases that automatically detect lost updates simplify application code
- Serializable Snapshot Isolation
- Two-phase locking
- Two-phase locking improves on Explicit Locks