question

ashok.dcosta_187920 avatar image
ashok.dcosta_187920 asked biswalkiran_184127 commented

cassandra compaction

Compaction in cassandra is merging data from multiple SS tables , does it perform splitting data from one ss table into multiple ones ?

cassandra
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

vikram.singh.chouhan_187371 avatar image
vikram.singh.chouhan_187371 answered biswalkiran_184127 commented

Hi @ashok.dcosta_187920: Compaction is the process of freeing up space by merging large accumulated data‐ files. So it is meant to merge smaller SST tables into a bigger one and not the other way around.

A compaction operation in Cassandra is performed in order to merge SSTables. SSTables are immutable, which helps Cassandra achieve such high write speeds. However, periodic compaction of these SSTables is important in order to support fast read performance and clean out stale data values. During compaction, the data in SSTables are merged: the keys are merged, columns are combined, obsolete values are discarded, and a new index is created.

For more details see How compaction works in Cassandra. Thanks!!


2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image Erick Ramirez ♦♦ commented ·

Thanks for being part of the community but I wanted to point out that these statements aren't always true and can be misleading to new users:

So it is meant to merge smaller SST tables into a bigger one and not the other way around.
SSTables are immutable, which helps Cassandra achieve such high write speeds.
0 Likes 0 ·
biswalkiran_184127 avatar image biswalkiran_184127 Erick Ramirez ♦♦ commented ·

In the process of this compaction does total number of SSTables decrease or increase? Having 600 SSTables for examples can be normal?

0 Likes 0 ·