temporal
temporal copied to clipboard
Cassandra schema should use default SizeTieredCompactionStrategy
The Cassandra schema uses LevelTieredCompaction (LCS) but likely should use default SizeTieredCompactionStrategy (STCS) instead. All of the tables seem to be configured with LCS but this is not a good general purpose configuration.
Level compaction (LCS) can involve significant write magnification, where data is re-written multiple times. In performance testing, reports show up to 13-fold write amplification with LCS. This blog article by ScyllaDB - a Cassandra compatible database -discusses the many downsides to using LCS:
- https://www.scylladb.com/2018/01/31/compaction-series-leveled-compaction/
The default STCS is preferred and works well for most workloads.
Hi Brad, It looks Temporal by default creating table using SizeTieredCompactionStrategy (STCS) ie., schema_version & schema_update_history tables, rest of them manually specifing compaction strategy is LevelTieredCompaction (LCS).
https://github.com/temporalio/temporal/blob/master/schema/cassandra/temporal/schema.cql#L53
Hello again! Thanks for answer, but why rest of tables indeed have old LevelTieredCompaction (LCS) instead more common and robust compaction type SizeTieredCompactionStrategy (STCS) ? Is this a secret meaning in that, or we can change compaction type of all tables on Size Tired compaction type by ourselfs?