This topic describes the physical backup modes and architecture.
Physical backup
OceanBase Database provides the online physical backup feature, which consists of log archiving and data backup. The log backup feature continuously backs up logs generated by a tenant, whereas the data backup feature backs up snapshots. Together, the two features can restore data to any point in time after the backup checkpoint.
Log archiving
OceanBase Database provides tenant-level log archiving capabilities.
The leader of a log stream is responsible for log archiving. Logs are physically backed up based on log streams at the log entry level.
The default log backup interval is 2 minutes. Logs can be backed up in quasi-real time. By default, directories are split by 24 hours to facilitate backup data management.
Compared with that in earlier version of OceanBase Databases, such as V2.2.x and V3.x, the log archiving feature in OceanBase Database V4.0.0 is no longer based on partition-level log management. This significantly reduces the number of I/O operations incurred in log archiving and effectively reduces performance requirements on the backup media.
Data backup
OceanBase Database provides tenant-level data backup capabilities.
The data backup process is scheduled by RootService, and data is backed up based on log streams. Backup data contains metadata and macroblock data of partitions. Physical backup refers to the backup of macroblock data. Metadata refers to the serialized values of memory data.
Each baseline macroblock in OceanBase Database has a global unique logical identifier, which enables incremental backup of reused macroblock data. In OceanBase Database, an incremental backup operation covers the backup of full metadata and incremental macroblock data. Data restore based on incremental backup is similar to that based on full backup. The two backup modes have no difference in terms of performance. In incremental backup-based mode, macroblocks are read among different backup_sets based on logical identifiers.
Compared with that in OceanBase Database V2.2.x and V3.x, data backup in OceanBase Database V4.0.0 no longer depends on the retention of data snapshots. Major freezes initiated during data backup will no longer cause a surge in disk space usage on OBServer nodes.
Data cleanup
OceanBase Database supports automatic cleanup for the specified backup path. RootService periodically checks the specified backup cleanup strategy and deletes unnecessary data backups. The system also deletes unnecessary log backups based on the earliest replay checkpoint of the retained data backups.