A memtable is an in-memory structure where ScyllaDB stores incoming writes before flushing them to immutable SSTable files. It provides quick access to recent data and buffers disk writes. section 6.2.2 section 8.3.1
A write follows this lifecycle:
- ScyllaDB writes the data to the memtable and appends it to the commit log for persistence. section 8.3.1
- The memtable grows while it buffers writes and provides access to recently written data. section 6.2.2 section 8.3.1
- When configured size limits are reached, ScyllaDB flushes the memtable to disk as a new immutable SSTable. section 6.2.2 section 8.3.1
- After a process death, ScyllaDB replays the commit log into the memtable before the data reaches SSTables again. section 8.3.1
Updating or deleting a row
An update first changes the memtable and commit log. A deletion follows the same path, storing a tombstone in both places; flushing later writes that tombstone into an SSTable. section 6.2.2 section 6.6
Figure 8.10 When data is written to the node, it first goes to the memtable and the commit log before eventually being flushed to disk into an SSTable.
Trace written data from the memtable and commit log to its eventual SSTable. section 8.3.1
