--:----:--Keyboard shortcuts (?)Fullscreen (f)
macOS ◆ xterm-256color ◆ zsh 371 views

OceanBase uses a LSM-based storage engine that is self-developed and battle-tested by many customers, including Alipay, GCash and DANA.

LSM tree consists of an in-memory B+-tree AKA as the memtable . Memtable accumulates writes and ultimately is being persisted on disk as SSTable (Sorted Strings Table).

To reduce write and space amplification, each SSTable is divided into 2MB blocks called macroblocks which is also the basic unit for writes during major compaction.

However reading 2MB blocks are too big for reads to be fast. Hence the read I/O operations of SSTables are performed based on microblocks, which are stored as the payload of each macroblock.

The concept of microblock is similar to that of page or block in traditional databases. However, based on the LSM-tree architecture, microblocks in OceanBase Database are compressed. When you create a table, you can set the block_size parameter to specify the size of microblocks before compression.

In this demo, we are inspecting the contents of a macroblock with ob_admin tool .