liveBook · Manning

Time-window compaction strategy

As explained in ScyllaDB in Action

Time-window compaction strategy is an SSTable compaction strategy that groups and compacts time-series data within bounded time windows.

Time-window compaction strategy (TWCS) groups SSTables containing time-series data by time window. When a window expires, Scylla compacts the SSTables in that window together. This organizes compaction around the age of data rather than its size or level. section 8.4.1 section 8.5

TWCS fits into Scylla’s broader compaction model:

  • Compaction combines SSTables and removes obsolete data when the necessary versions are included together. section 8.4.1
  • Unlike size-tiered compaction, which groups SSTables by size, TWCS groups them by time window. section 8.4.1
  • Unlike leveled compaction, which organizes SSTables into levels, TWCS waits for a time window to elapse before compacting that window’s data. section 8.4.1 section 8.5
Figure 8.18 TWCS is only used with time series data, dividing the data into windows and compacting it together when the window expires.
figure

The figure illustrates TWCS dividing time-series data into windows and compacting each window after it expires. section 8.4.1

How ScyllaDB in Action covers it

How deep it goes
Explains TWCS’s grouping rule and expiration trigger, without detailing configuration or operational procedures.
Examples
Uses a figure showing time-series data divided into windows and compacted when each window expires.
What it assumes
Assumes familiarity with SSTables and explains TWCS within Scylla’s general compaction model.
What you can do after
Evaluate TWCS as Scylla’s compaction option for tables containing time-series data.
How it connects
Connects time-series data with SSTables, compaction, size-tiered compaction, and leveled compaction.

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.