In Apache Druid, Compaction basically helps with managing the segments for a given datasource. Using compaction, we can either merge smaller segments or split large segments to optimize segment size. One of the first options to consider would be to determine, if the segments could be generated optimally. If that isn’t possible, compaction would be required.