Question-: Compaction is a process A. Which deletes data from memtables B. Which deletes data from SSTables C. It merges the various SSTables D. It deletes the Tombstone marked data
Answer: C,D
Explanation: Compaction is a process, which periodically merges SSTables and discard the old data which is marked as a Tombstone. compaction works on collection of SSTables, it collects all the version of each unique row and assemble them to create one complete row using the most up to date data. It uses the timestamp of each rows to create up to date data. As you know rows in the SSTables are already sorted by partition key hence merging the SSTables is very performant and it does not use the random input and output. After merging the SSTable a new SSTable would be created.
Question-: Which of the following is true for the leveled compaction strategy? A. It is very IO intensive process. B. It compacts many more SSTable at once then size tiered compaction C. This is executed more frequently than size tiered compaction. D. None of the above
Answer: A,B,C
Explanation: There are pros and cons of using a particular strategy for compaction. • Using this strategy, you can easily predict, what is your disc requirement as well as your read operation latency are more predictable. Stale data would be removed very frequently. • But it is very IO intensive operation and affect overall operation latency.
In this case series of compaction operation happens level by level. At first data in the memtable is flushed to the SSTable and create the level 0. Then at the next level all the SSTable would be merged and create the level one SSTable. So, there are multiple configuration for this which initiate the compaction for each level.
Question-: In which scenario do you think leveled compactions is a good strategy? A. When your table has high write. B. when your table has very intensive read operations. C. it does not matter; it is good for every situation other than time series data. D. you should avoid this compaction strategy altogether.
Answer: B Exp: When you perform too many writes on the table then level compaction would happen very frequently. Which would create a lot of IO and your overall read latency would be affected for this table. Hence, you should use leveled compaction strategy when your table has intensive read operation and lesser write operation. So that leveled compaction would be initiated less frequently.