To provide more cost-effective database services in a multi-cloud environment, OceanBase Database implements the shared-storage cluster architecture based on general object storage. In the shared-nothing architecture, the system caches hot data in memory to improve performance. In the shared-storage architecture, in addition to memory caching, local persistent caching is introduced to cache sub-hot data.
Memory cache: Caches the most hot data, including microblocks and index data.
Persistent cache: Stores data on local physical disks or cloud disks to cache sub-hot data. Its main features are as follows:
Caches data read from object storage.
Pre-reads data. For example, when a full table scan is performed, data to be read is pre-cached to the local disk.
Warms up. Before major compactions, hot data is loaded to the local cache. After a short-term system crash and restart, the persistent cache remains valid to reduce performance fluctuations in disaster recovery scenarios.
To ensure the RTO time, the access sequence of the local persistent cache is synchronized in real time to the follower replica. The leader and follower replicas have nearly the same cache data. During data replication and migration, the local cache data is also transferred to the target, ensuring the performance after replication and migration.
Write cache: Uses the low latency of local disks as a write cache to record some important local states, such as metadata files, the latest clogs, and mini-dumps.
Object storage: Stores all data of the system, including shared clogs of the cluster, baseline data, and node-private data, such as incremental data and temporary files, when the local physical disk or cloud disk space is insufficient. The object storage capacity is almost unlimited, but the access latency is high.
The multi-level caching ensures the access performance of hot data and provides a product that meets the requirements of both TP and AP businesses based on object storage.