This topic describes how dumping works.
The storage engine of OceanBase Database uses the log-structured merge-tree (LSM-tree) architecture. Data is roughly divided into MemTable and SSTable. SSTables are further subdivided into Mini SSTable, Minor SSTable, and Major SSTable.
Dumping includes two processes: Mini Compaction and Minor Compaction. When the memory usage of a MemTable reaches a certain threshold, data in the MemTable needs to be stored to a Mini SSTable on the disk to release memory space. This process is called Mini Compaction. As user data is continuously written, the number of Mini SSTables increases. When the number of Mini SSTables exceeds a certain threshold, Minor Compaction is automatically triggered in the background. Before dumping, you must ensure that the MemTable to be dumped no longer accepts new data writes. This process is called a minor freeze. A minor freeze prevents new data from being written to the current active MemTable and generates a new active MemTable.
Layered strategy for SSTables
OceanBase Database introduces a layered strategy for SSTables during dumping, adding the L0 layer on the original basis.
L0 layer (Mini SSTable)
A frozen MemTable is directly flushed into a Mini SSTable. OceanBase Database can have multiple Mini SSTables at the same time.
L1 layer (Minor SSTable)
In most cases, only one Minor SSTable exists.
A new Minor SSTable is generated at the L1 layer from multiple Mini SSTables at the L0 layer and the original Minor SSTable.
L2 layer (Major SSTable)
Baseline data, generated during a major compaction. In general, only one Major SSTable exists.
The following figure shows how the layered strategy for SSTables works internally.

Trigger methods
Dumping supports automatic triggering and manual triggering.