What are the four standard transaction isolation levels and what concurrency phenomena does each prevent?
Last updated
From weakest to strongest:
READ UNCOMMITTEDprevents nothing (dirty reads allowed).READ COMMITTEDprevents dirty reads and is the default in most engines.REPEATABLE READalso prevents non-repeatable reads, but the standard still permits phantoms.SERIALIZABLEprevents all three, as if transactions ran one at a time.The anomalies, in order, are dirty read, non-repeatable read, and phantom read. Stronger levels trade away concurrency for correctness.
- https://www.geeksforgeeks.org/dbms/transaction-isolation-levels-dbms/
- https://www.postgresql.org/docs/current/transaction-iso.html
- https://www.postgresql.org/docs/6.5/mvcc3058.htm
- https://dev.to/devcorner/understanding-database-isolation-levels-a-developers-guide-to-consistent-transactions-6og
- https://dev.to/jad_core/database-concurrency-phenomena-isolation-label-read-phenomena-and-serialization-anomaly-3485
- https://levelup.gitconnected.com/database-isolation-levels-explained-like-youre-10-48df02faa8ea
- https://campus.datacamp.com/courses/transactions-and-error-handling-in-sql-server/controlling-the-concurrency-transaction-isolation-levels?ex=1
- https://learn.microsoft.com/en-us/sql/odbc/reference/develop-app/transaction-isolation-levels?view=sql-server-ver17