Skip to content
C

Durability


Durability

Definition

Durability (the D in ACID) guarantees that once a transaction COMMITS, its changes are permanent — they survive any subsequent crash, power failure, or restart, with no risk of silently reverting.

How It Works

The moment COMMIT returns successfully, the database has typically written the change to durable storage (disk) — often via a write-ahead log (Chapter 26, Recovery and Logging) — so that even if the server crashes one millisecond later, the committed change can be recovered and is not lost. This is the property that makes "the transaction succeeded" a statement you can actually rely on.

Edge Cases and Pitfalls

  • Durability is specifically about COMMITTED changes — a transaction that crashes BEFORE reaching commit has no durability guarantee for its (necessarily rolled-back, per Atomicity) partial work; there's nothing to "keep" since it never completed.
  • Some systems offer a deliberately WEAKER durability mode (trading some durability guarantee for higher write throughput, e.g. delaying the disk write slightly) as an explicit performance trade-off — this is a genuine configuration choice in some engines/settings, not a universal constant, and should be understood as an explicit risk when enabled.
  • Durability relies on the actual physical storage medium behaving as expected — a genuinely faulty disk or a misconfigured/lying storage layer (claiming a write succeeded when it didn't) can violate durability despite the database doing everything correctly on its end; this is why real systems often add extra safeguards (replication, checksums) beyond what a single disk's guarantee alone provides.

Key Takeaways

  • Durability guarantees committed changes survive crashes and restarts — commit is a reliable, permanent promise.
  • Durability only applies to what actually reached COMMIT; a crash before commit has nothing to preserve (that work is rolled back per Atomicity).
  • Some systems offer configurable, weaker durability trade-offs for performance — a genuine, explicit risk when chosen, not a given.

Mock Test

  • Durability - Quick Test

    8 questions on Durability.

    8 questions · 8 min · Medium
    Start Mock Test