# Durability and Consistency in Storage Systems
Durability and consistency are two of the core guarantees storage systems provide. Durability means that once data is acknowledged as written, it survives crashes and power loss. Consistency means readers see a coherent view of that data, even across replicas and concurrent writers.
## Core techniques
- **Write-Ahead Logging (WAL)**: changes are recorded to a sequential log on durable storage before being applied to the main data structures, so the log can replay anything lost in a crash.
- **fsync**: forces buffered writes out of the operating system's page cache onto the underlying device, which is what turns "the OS accepted the write" into "the write will survive power loss".
- **Compaction**: merges log-structured writes into larger, sorted files over time, reclaiming space and keeping reads efficient.
# References