What are the differences between the storage engine of OceanBase Database and that of conventional databases?
OceanBase Database adopts a read/write separation architecture. Data is divided into baseline data and incremental data. Incremental data is stored in memory (MemTable), and baseline data is stored on SSD (SSTable). You can only modify incremental data in MemTables. All DML operations are performed on MemTables, providing excellent performance. During data reading, data of previous versions in MemTables and the baseline data in persistent storage are compacted to generate the updated data. OceanBase implements both block cache and row cache in the memory to avoid random read of the baseline data. When the incremental data in a MemTable reaches a specified size, the incremental data is compacted with the baseline data and then persisted to the disk. The system performs a daily major compaction during idle hours every night.
How is data stored in OceanBase Database?
Data files in OceanBase Database are stored in macroblocks. The size of each macroblock is 2 MB. A macroblock is divided into microblocks (16 KB before compression). Each microblock contains two or more rows. A microblock is the smallest I/O unit of OceanBase Database.
Do I need to use a partitioned table?
You can refer to the following information to decide whether to use a partitioned table:
If the data volume of your table may exceed 200 GB in the foreseeable future, we recommend that you use a partitioned table.
If data in your table is evenly distributed along the timeline, we recommend that you use a partitioned table.
What are the differences between a local index and a global index in OceanBase Database in terms of implementation?
Differences between a local index and a global index:
Local index: The index is bound to a single table or the smallest subpartition of a partitioned table. No additional partitioning record is created in the system tenant of OceanBase Database. All local index-based SQL statements are executed locally.
Global index: You need to create an additional partitioning record in the system tenant of OceanBase Database. You can take a global index as a table, which occupies an additional partition quota. The global index has its own partitioning strategy. It is not bound to the primary table. Even if a global index is created on a single table, it can be stored on a different node from that of the primary table. This easily makes an SQL database a distributed database.