Readablewiki

Durability (database systems)

Content sourced from Wikipedia, licensed under CC BY-SA 3.0.

Durability in database systems is the guarantee that once a transaction has been committed, its effects are permanent. This means the data will stay correct even if the system crashes or there is a disaster afterward.

Durability must handle three kinds of failures:
- Transaction failures: errors, cancellations, or timeouts that prevent a transaction from completing.
- System failures: loss of the computer’s volatile memory during a crash or power failure.
- Media failures: problems with storage devices, like disks, that hold data long-term.

How durability is achieved
- At the transaction level: when changes are made, the system can distinguish between committed and uncommitted work. Committed changes stay, while uncommitted changes are discarded. Techniques like serializability help ensure that the final outcome is consistent, and logs or other history-tracking methods help undo bad or partial work.
- Logging and recovery: most systems use a write-ahead log (WAL). Before any change is written to stable storage, a log entry records what will be done. If something crashes, the log lets the system redo committed transactions and undo those that didn’t complete.
- At the system level: volatile memory (RAM) is vulnerable to crashes. Durability relies on non-volatile storage (like disks or emerging non-volatile memory) and the WAL to reconstruct the correct state after a failure.
- At the media level: to guard against disk or hardware failures, databases use replication, backups, and disaster-recovery plans. Stable memory and robust writing practices help ensure data can be rebuilt from logs or replicas if needed.

Distributed databases add another layer: several nodes must agree before a transaction is considered committed. This coordination is often handled by a two-phase commit protocol. Real-world durability also uses recovery techniques from ARIES, a family of algorithms that manage how to redo and undo actions across failures and restarts.

In short, durability means carefully recording and managing changes so that committed work survives failures, while incomplete work can be safely undone and the system can be rebuilt accurately from logs and replicas.


This page was last edited on 2 February 2026, at 21:38 (CET).