Part 4 of 5 · 2 min read
Isolation and durability
Isolation governs what concurrent transactions can see of each other; durability governs what survives a crash after commit.
Isolation and durability
Think of two people editing the same shared document at once. Isolation decides how much of each other's unsaved edits they can see; durability decides whether a save, once confirmed, survives a sudden power outage moments later.
In plain words: isolation guarantees that concurrent transactions do not see each other's incomplete, uncommitted changes in ways that break correctness, with exactly how much isolation is provided depending on the isolation level in effect, covered in depth later in this level. Durability guarantees that once a transaction commits, its changes survive any subsequent crash, relying on the write-ahead logging and recovery mechanisms covered in Level 4 and Level 8. These two properties address different moments: isolation concerns transactions running at the same time, while durability concerns what happens after one has already finished successfully.
A worked example. Isolation prevents one transaction from seeing another's half-finished bank transfer mid-update; durability guarantees that once that transfer's COMMIT succeeds, the new balances survive even if the server crashes one second later.
The key lines. No new SQL; isolation and durability are both guarantees the database provides automatically once a transaction commits, governed by settings and mechanisms covered later in this level and in Level 8.
Isolation, durability
Isolation guarantees concurrent transactions cannot see each other's incomplete changes in ways that break correctness; durability guarantees a committed transaction's changes survive any later crash.
Example: hiding another editor's unsaved changes is isolation; a confirmed save surviving a power outage is durability.
Remember this
Atomicity is about all-or-nothing completion; consistency is about satisfying declared rules; isolation is about what concurrent transactions can see of each other; durability is about surviving a crash after commit. Keeping these four questions separate is what the rest of this level builds on.
Quick notes
- Atomicity: a transaction's effects happen entirely or not at all.
- Consistency: a transaction only moves between states satisfying declared rules, which depend on the schema and application.
- Isolation: concurrent transactions cannot see each other's incomplete changes in ways that break correctness.
- Durability: a committed transaction's changes survive any later crash.
- Each property addresses a distinct failure mode; a database missing one can still appear to work most of the time.