The invention discloses a
database construction method based on
hybrid heap allocation and versioned storage, and relates to the technical field of databases. The method comprises the following steps: establishing a
database file
structure system comprising a
data file, a
metadata file, a function file, a mode file and an extension file; the method comprises the following steps: constructing a versioned storage manager adopting a
hybrid heap
allocation algorithm, dividing a heap memory into memory pages and memory blocks with fixed sizes, managing the free memory pages by using a free
linked list, recording the allocation state of the memory blocks in a
bitmap, and adding version header information for the memory blocks; establishing a version index
mechanism based on a persistent B + tree; and a historical data tracking function is realized. According to the method, the advantages of the idle
linked list and the
bitmap are combined, the memory allocation efficiency is guaranteed, the damage resistance of the
system is improved, and meanwhile, complete historical tracking of the data is achieved through a versioning storage mechanism.