A compaction strategy is a table-level policy that determines how SSTables are grouped and merged. Compaction removes obsolete data created when repeated row updates leave multiple versions across SSTables, helping prevent database growth and increasingly slow reads. section 8.4.1
ScyllaDB supports these strategies:
- Size-tiered compaction (STCS) groups similarly sized SSTables into buckets and compacts a bucket when it reaches capacity. It is the default and usually produces fewer, larger SSTables, but may delay obsolete-data removal and require substantial temporary disk space. section 8.4.1
Choosing and changing a strategy
A table can select STCS during creation with `WITH compaction = {'class': 'SizeTieredCompactionStrategy'}`. An existing table can be changed to LCS with `ALTER TABLE reviews.authors WITH compaction = {'class': 'LeveledCompactionStrategy'};`.
