This invention relates to the field of
database systems and storage systems, and in particular to a writing method and apparatus based on a computable storage device. The method includes receiving a write transaction for a
database; when the
database is under non-write-intensive load, writing the flushed data corresponding to the write transaction to the actual
storage area based on a B+ tree index structure; dividing the entire
key space of the database into multiple partitions according to the range of keys, and for each partition, storing the key value falling into the partition and a pointer to the actual data in the leaf nodes of an adaptive
radix tree, obtaining a multi-instance adaptive
radix tree index structure; when the database is under write-intensive load, writing the flushed data corresponding to the write transaction to the
virtual storage area of the computable storage device based on the multi-instance adaptive
radix tree index structure, and having the computable storage device complete the process of migrating the flushed data from the
virtual storage area to the actual
storage area. This invention can improve write performance.