Database / ScyllaDB Interview questions
Explain the purpose of the commit log in ScyllaDB?
The commit log is an append-only, on-disk log that ScyllaDB writes to before acknowledging any write, purely for crash recovery. Every mutation is appended sequentially to the commit log at the same time it's applied to the in-memory memtable, so a sequential disk write, which is fast, stands in for a full random-access flush on every write.
If a node crashes before its memtables are flushed to SSTables, the commit log is replayed on restart to reconstruct any data that hadn't yet been persisted as an SSTable. Once a memtable is flushed to disk as an immutable SSTable, the corresponding commit log segments are no longer needed for recovery and get recycled. This design is what lets ScyllaDB acknowledge writes quickly while still guaranteeing durability against a node crash.
More Related questions...