# Isolation in ACID Transactions

> Isolation, the I in ACID, defines how much one transaction is shielded from the effects of other transactions running at the same time, so concurrent transactions do not interfere with each other's results. Databases offer four standard isolation levels: Read Uncommitted, Read Committed, Repeatable Read and Serializable, ordered from the weakest protection to the strictest.

Canonical: https://devsunite.com/resources/core-subjects/dbms/isolation
Last updated: 2026-11-22

Subject: DBMS · Category: ACID Properties · 4 min read

Isolation, the "I" in ACID, defines how much one transaction is shielded from the effects of other transactions running concurrently. In a database with many users at once, isolation is what determines whether a transaction sees a clean, consistent view of the data, or gets exposed to another transaction's half-finished work.

## Why isolation is genuinely hard

If every transaction ran one at a time, isolation would be trivial. Real databases need many transactions running simultaneously for performance, and that concurrency creates real risks: one transaction reading a row another transaction is in the middle of updating, two transactions both reading the same row and both trying to update it based on stale data, or a transaction reading the same row twice and getting two different answers because another transaction committed in between.

## The four standard isolation levels

1. **Read Uncommitted.** A transaction can see another transaction's uncommitted changes (a "dirty read"). This is the weakest level and rarely used in practice.
2. **Read Committed.** A transaction only ever sees data that has been committed by other transactions, never uncommitted changes. This is the default in many databases (including PostgreSQL). It still allows a "non-repeatable read," reading the same row twice in one transaction can return different values if another transaction committed a change in between.
3. **Repeatable Read.** Once a transaction reads a row, it's guaranteed to see the same value for that row if it reads it again, even if another transaction commits a change to it in the meantime. This prevents non-repeatable reads but can still allow "phantom reads," a new row matching a query's filter can appear on a second run of the same query.
4. **Serializable.** The strictest level: transactions behave as if they ran one at a time, in some serial order, even though they're actually running concurrently. This eliminates all the anomalies above but costs the most in performance, since the database has to do more work to guarantee it.

## A worked example

Two transactions, T1 and T2, both interact with an `inventory` table where `widget` currently has `stock = 5`.

```
T1: BEGIN
T1: SELECT stock FROM inventory WHERE item = 'widget';   -- reads 5
T2: BEGIN
T2: UPDATE inventory SET stock = stock - 1 WHERE item = 'widget';
T2: COMMIT                                                 -- stock is now 4
T1: SELECT stock FROM inventory WHERE item = 'widget';   -- reads 4? or still 5?
T1: COMMIT
```

Under Read Committed, T1's second read would see `4`, since T2's change is now committed and visible. Under Repeatable Read or Serializable, T1's second read would still see `5`, the value it originally read, because those isolation levels guarantee a transaction's own view of data it already read stays consistent for the rest of that transaction.

## Where this matters in real systems

Most production applications run at Read Committed by default (it's PostgreSQL's and Oracle's default) because it's a reasonable tradeoff between correctness and throughput for the majority of everyday queries. Financial systems and anything doing balance checks before a debit typically bump up to Serializable or use explicit row locking, since the cost of a subtle concurrency bug (double-spending a balance, overselling inventory) is much higher than the performance cost of stricter isolation.

## What interviewers actually ask about isolation

- **"Name the four standard isolation levels, from weakest to strongest."** Read Uncommitted, Read Committed, Repeatable Read, Serializable.
- **"What's a dirty read, and which isolation level allows it?"** Reading another transaction's uncommitted changes; only Read Uncommitted allows this.
- **"What's the difference between a non-repeatable read and a phantom read?"** A non-repeatable read is the same row returning a different value on a second read; a phantom read is a new row appearing that matches a query's filter on a second run.
- **"What's the tradeoff of using Serializable everywhere?"** It eliminates every concurrency anomaly but at a real performance cost, since the database has to do more work (often more locking or conflict detection) to guarantee transactions behave as if fully sequential.

## Key takeaways

- Isolation controls how much one transaction's changes are visible to other concurrent transactions.
- The four standard levels, from weakest to strongest, are Read Uncommitted, Read Committed, Repeatable Read, and Serializable.
- Stronger isolation prevents more anomalies (dirty reads, non-repeatable reads, phantom reads) but costs more in performance.
- Read Committed is the common real-world default; Serializable is reserved for cases where correctness matters more than raw throughput.

## Related

- [Previous: Consistency in ACID Transactions](https://devsunite.com/resources/core-subjects/dbms/consistency)
- [Next: Durability in ACID Transactions](https://devsunite.com/resources/core-subjects/dbms/durability)
- [More in ACID Properties: What Is a Transaction in a Database?](https://devsunite.com/resources/core-subjects/dbms/what-is-a-transaction)
- [More in ACID Properties: Atomicity in ACID Transactions](https://devsunite.com/resources/core-subjects/dbms/atomicity)
- [More in ACID Properties: ACID Properties: Complete Overview](https://devsunite.com/resources/core-subjects/dbms/complete-overview)
- [All 174 DBMS interview questions](https://devsunite.com/resources/core-subjects/dbms)
