What does durability mean?
Durability is a transaction property guaranteeing that once a result is committed, it won't be lost, even if a failure occurs: a power outage, a server crash, a process restart, or a system restart.
What exactly is guaranteed
- data that was successfully committed will definitely reach durable storage (disk, a log, WAL/oplog, and so on)
- after a restart, the database can restore the committed state
- the data can no longer roll back, because the transaction is finished
How this is achieved technically
Different DBMSs implement Durability through:
- operation logs (a Write-Ahead Log, an oplog)
- fsync / filesystem journaling
- replication (in distributed systems)
- checkpoints
The gist is the same: before confirming a transaction, the system guarantees the changes are written to durable storage, not just held in memory.
Example
If a transaction transferred money between accounts and returned commit OK, then:
- even if the server crashes instantly, a second later
- after a restart, the data will be in the state it was in at the moment of commit
The short definition
Durability = "after a commit, the data won't disappear or roll back, the system guarantees it's preserved".
This property closes off the last risk: losing or rolling back changes that were already accepted.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.