The invention relates to the field of databases, in particular to a file merging method and device based on a cassandra
database. The method mainly comprises the steps of receiving a
data file generated by a
database, and generating a merged file
list of each disk; obtaining a merged file
list of the corresponding disk by the merging process of each disk, and obtaining the size of a
data file needing to be merged in the merged file
list of each disk; starting; and in the parallel merging process of the
database, when the sum of the sizes of the data files acquired by the merging process of each disk reaches a merging file threshold value, merging the data files needing to be merged in all the disks at one time by the parallel merging process. According to the method, the
small files can bemerged in time under the condition that few merging
layers and temporary files are used, the merging frequency is reduced, the occupied space of the files in the disk is reduced, the disk IO frequency and disk IO competition are reduced, the file merging performance is improved, and the read-write stability of the database is improved.