Database / RocksDB Basics Interview Questions
What is a Write-Ahead Log (WAL) in RocksDB?
The Write-Ahead Log is a sequential, on-disk log that RocksDB appends every write to, in addition to applying it to the in-memory MemTable.
- Provides durability, if the process crashes before a MemTable is flushed to disk, the WAL can be replayed to recover those writes
- Written sequentially, which is fast even on spinning disks, unlike the random writes a naive design might require
- Can optionally be disabled for extra write speed, at the cost of losing durability guarantees on crash
The WAL is what lets RocksDB keep writes primarily in fast memory while still guaranteeing they won't simply vanish if the process crashes unexpectedly.
More Related questions...