liveBook · Manning

Memtable

As explained in ScyllaDB in Action

A memtable is an in-memory data structure that temporarily stores database writes before they are flushed to durable storage.

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.
figure

Trace written data from the memtable and commit log to its eventual SSTable. section 8.3.1

How ScyllaDB in Action covers it

How deep it goes
Explains the write lifecycle, persistence protection, flushing, recovery, and node-level sharding, but defers detailed SSTable internals.
Examples
Uses ordinary updates, deletions represented by tombstones, commit-log replay, and a lifecycle figure tracing data into SSTables.
What it assumes
Assumes basic awareness of database writes while introducing commit logs, SSTables, tombstones, and node-level storage flow.
What you can do after
Evaluate how ScyllaDB buffers writes, protects unflushed data, and moves it into durable SSTables.
How it connects
Connects memtables to commit logs, SSTables, tombstones, compaction, row caches, and shard-per-core architecture.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.