liveBook · Manning

Leveled compaction strategy

As explained in ScyllaDB in Action

Leveled compaction strategy is an SSTable compaction strategy that organizes fixed-size files into levels with non-overlapping key ranges within each level.

Leveled compaction strategy (LCS) organizes fixed-sized SSTables into levels. Within each level, a partition key appears in only one SSTable, and compaction runs when a level fills. section 8.4.1 section 8.5

LCS differs from the other ScyllaDB compaction strategies in several practical ways:

  • It uses levels rather than size-based tiers, unlike size-tiered compaction strategy. section 8.4.1
  • It keeps a partition in only one SSTable per level, reducing duplicate partition placement within that level. section 8.5
  • It is one of three standard strategies alongside size-tiered and time-window compaction; size-tiered is the default. section 8.4.1

Selecting LCS for a table

Set the table's compaction strategy with CQL: ALTER TABLE reviews.authors WITH compaction = {'class': 'LeveledCompactionStrategy'};

How ScyllaDB in Action covers it

How deep it goes
Explains fixed-sized SSTables, per-level partition placement, and fill-triggered compaction without detailed sizing or tuning guidance.
Examples
Uses an ALTER TABLE statement and a figure showing fixed-sized SSTables divided into levels.
What it assumes
Assumes familiarity with SSTables and compaction while contrasting LCS with size-tiered and time-window strategies.
What you can do after
Operate/configure LCS by assigning LeveledCompactionStrategy to a ScyllaDB table with ALTER TABLE.
How it connects
Connects LCS with SSTables, memtables, minor compaction, and size-tiered and time-window compaction strategies.

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.