liveBook · Manning

Size-tiered compaction strategy

As explained in ScyllaDB in Action

Size-tiered compaction strategy is an SSTable compaction strategy that groups files into size-based buckets and compacts full buckets together.

Size-tiered compaction strategy (STCS) groups SSTables into buckets according to size. When a bucket reaches its configured capacity, Scylla compacts all its SSTables into one larger SSTable, which may fill a higher tier and trigger another compaction. section 8.4.1

STCS has practical consequences for table operations:

  • It is Scylla’s default strategy and generally produces fewer SSTables, though those files are larger. section 8.4.1
  • Obsolete row versions can remain distributed across SSTables until a tier fills, so cleanup may be delayed. section 8.4.1
  • Compaction can require substantial temporary disk space; in the worst case, about half the disk may need to remain free. section 8.4.1
  • STCS differs from leveled compaction strategy and time-window compaction strategy, which organize SSTables by levels or time windows. section 8.5

Configuring STCS

A table can explicitly select the strategy with CQL: CREATE TABLE ... WITH compaction = {'class': 'SizeTieredCompactionStrategy'} ...

How ScyllaDB in Action covers it

How deep it goes
Explains size buckets, capacity triggers, cascading tiers, obsolete-data delays, and temporary disk requirements.
Examples
Uses size-based SSTable buckets, cascading tier creation, and a CQL table-compaction declaration.
What it assumes
Assumes familiarity with tables and SSTables while connecting SSTables to memtable flushes and compaction.
What you can do after
Operate/configure tables with STCS and anticipate its SSTable-count, cleanup, and disk-space consequences.
How it connects
Connects SSTables with memtable flushing, leveled compaction strategy, time-window compaction strategy, and incremental compaction strategy.

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.