Quick revision
The short answer
Snapshot isolation guarantees that every transaction reads from one consistent snapshot taken at its start and that, when two concurrent transactions write the same row, only one of them may commit. That prevents dirty reads, non-repeatable reads, phantoms in reads and lost updates, but it still allows write skew and read-only anomalies, so it is not serializable. PostgreSQL REPEATABLE READ and Oracle SERIALIZABLE are snapshot isolation; MySQL InnoDB REPEATABLE READ is not quite, because its writes act on the latest committed data.
What to remember
In this answer, we saw that snapshot isolation means reading from one consistent snapshot and aborting one of two concurrent writers of the same row. It prevents dirty reads, non-repeatable reads, phantoms in reads and lost updates, but allows write skew and read-only anomalies, so it is not serializable. PostgreSQL REPEATABLE READ and Oracle SERIALIZABLE are snapshot isolation and raise 40001 and ORA-08177; InnoDB REPEATABLE READ snapshots only plain reads, so lost updates can slip through. Applications must retry on serialization errors.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Snapshot isolation guarantees that every transaction reads from one consistent snapshot taken at its start and that, when two concurrent transactions write the same row, only one of them may commit. That prevents dirty reads, non-repeatable reads, phantoms in reads and lost updates, but it still allows write skew and read-only anomalies, so it is not serializable. PostgreSQL REPEATABLE READ and Oracle SERIALIZABLE are snapshot isolation; MySQL InnoDB REPEATABLE READ is not quite, because its writes act on the latest committed data.
Why this question is asked
Isolation level names are one of the most misleading parts of SQL. The same word, SERIALIZABLE or REPEATABLE READ, means different things in different products, and the behaviour that actually matters is often snapshot isolation under another name. Interviewers ask this to find out whether we know the real guarantees and their gaps, because code that is correct on one database can quietly break on another. In this answer, we will define snapshot isolation precisely, go through what it prevents and what it allows, compare PostgreSQL, Oracle and MySQL, and finish with what applications must do about it.
1What Snapshot Isolation Is
Snapshot isolation has two rules. The first is about reads: a transaction sees the database exactly as it was at one moment, its start, plus its own changes. Other transactions may commit new data while it runs; it will not see any of it. The second is about writes: if two concurrent transactions, meaning transactions whose lifetimes overlap, both write the same row, only one may commit. The other aborts. This is often described as first committer wins; PostgreSQL implements it as first updater wins, because the second writer waits for the first and then fails if the first committed.
Notice what the write rule does not look at. It compares the rows two transactions write, not the rows they read. That single gap explains everything snapshot isolation allows.
2What It Prevents and What It Allows
Because every read comes from the snapshot, a transaction cannot see uncommitted data (no dirty reads), cannot read the same row twice and get different values (no non-repeatable reads), and cannot run the same query twice and see new rows appear (no phantoms in its reads). Because of the write rule, two transactions cannot both read a balance and write a new value for the same row: the second one aborts, so lost updates are prevented.
What it allows is write skew: two transactions read overlapping data, each writes a different row, and together they break a rule, such as two doctors both going off call. It also allows a subtler read-only anomaly, where a transaction that only reads sees a state that no serial order could have produced. Since serializable means 'equivalent to some one-at-a-time order', snapshot isolation is weaker than serializable.
| Anomaly | Under snapshot isolation |
|---|---|
| Dirty read | prevented |
| Non-repeatable read | prevented |
| Phantom in reads | prevented |
| Lost update | prevented: second writer aborts |
| Write skew | allowed |
| Read-only anomaly | allowed |
3PostgreSQL REPEATABLE READ and Oracle SERIALIZABLE
PostgreSQL's REPEATABLE READ is snapshot isolation. The snapshot is taken at the first statement of the transaction, and an attempt to update or delete a row that a concurrent transaction changed and committed fails.
Oracle's level called SERIALIZABLE is also snapshot isolation, not true serializability, and it reports the same conflict as ORA-08177. Oracle has no stronger level. PostgreSQL does: since version 9.1 its SERIALIZABLE adds Serializable Snapshot Isolation, which also tracks reads and aborts transactions that would produce write skew.
4MySQL InnoDB REPEATABLE READ Is Different
InnoDB's REPEATABLE READ gives plain SELECTs a consistent snapshot, so reads look like snapshot isolation. Writes do not. An UPDATE, a DELETE and a locking read (SELECT ... FOR UPDATE or FOR SHARE) operate on the latest committed version of the row, not on the snapshot, and they do not fail when the row changed after the snapshot.
So the classic lost update, read a value then write an absolute value computed from it, goes through in InnoDB without an error, while PostgreSQL REPEATABLE READ would abort it. That is why InnoDB's REPEATABLE READ is not true snapshot isolation, even though its reads look like it. On the other hand, InnoDB adds gap and next-key locks to locking reads, which PostgreSQL does not have.
5What Applications Must Do
Under snapshot isolation a transaction can be aborted simply because another transaction won a race. That is normal, not a bug, so the application must catch the serialization error (SQLSTATE 40001 in PostgreSQL, ORA-08177 in Oracle) and retry the whole transaction from the start in a new transaction. Retries are cheap only if transactions are short and have no side effects, like sending an email, inside them. For rules that span rows, the application also needs protection beyond snapshot isolation: a constraint, a lock on the rows read, or PostgreSQL's SERIALIZABLE.
6Follow-up questions
Give an example of a read-only anomaly under snapshot isolation.
Take a savings balance X and a checking balance Y, both 0. T2 withdraws 10 from checking: it reads X and Y, sees a total below 10, so it charges a fee of 1 and will write Y = -11. Before T2 commits, T1 deposits 20 into savings, writes X = 20 and commits. Then a read-only report T3 starts and reads X = 20 and Y = 0, and commits. Finally T2 commits Y = -11. The fee says T2 ran before the deposit, but the report saw the deposit without the withdrawal, which says the deposit came first. No serial order fits both, yet without T3 the history would have been fine. PostgreSQL SERIALIZABLE catches this.
Why is the write rule enough to stop lost updates but not write skew?
A lost update always means two transactions writing the same row, which the rule detects. Write skew writes different rows, so the rule sees no overlap.
Is PostgreSQL READ COMMITTED snapshot isolation?
No. Each statement gets its own snapshot, so a transaction can see different data from one statement to the next, and there is no write-conflict abort; an UPDATE simply re-reads the latest version.
7Conclusion
In this answer, we saw that snapshot isolation means reading from one consistent snapshot and aborting one of two concurrent writers of the same row. It prevents dirty reads, non-repeatable reads, phantoms in reads and lost updates, but allows write skew and read-only anomalies, so it is not serializable. PostgreSQL REPEATABLE READ and Oracle SERIALIZABLE are snapshot isolation and raise 40001 and ORA-08177; InnoDB REPEATABLE READ snapshots only plain reads, so lost updates can slip through. Applications must retry on serialization errors.
Open with
Snapshot isolation gives two guarantees. Every transaction reads from one consistent snapshot taken at its start, and if two concurrent transactions write the same row, only one can commit; the other aborts.
Then, if they want more
So it prevents dirty reads, non-repeatable reads, phantoms in what it reads, and lost updates. What it doesn't do is look at reads when checking conflicts, so it allows write skew, where two transactions read the same data and write different rows, and also a read-only anomaly where a reporting transaction sees a state no serial order could produce.
So it's not serializable. PostgreSQL's REPEATABLE READ is snapshot isolation, and the losing writer gets could not serialize access, SQLSTATE 40001. Oracle's SERIALIZABLE is really snapshot isolation too, and it raises ORA-08177.
MySQL InnoDB's REPEATABLE READ is different: plain selects use a snapshot, but updates and locking reads work on the latest committed row and don't fail, so a read-then-write can lose an update. That's why I wouldn't call it true snapshot isolation. In all of them, the application has to be ready to retry the whole transaction on a serialization error.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "What exactly does snapshot isolation guarantee and what does it not? Relate it to...": https://scrivio-interview-library.netlify.app/databases/acid-and-isolation/9f8c0d2910/