This topic describes the physical backup modes and architecture.
Physical backup
OceanBase Database provides the online physical backup feature, which consists of log backup and data backup. The log backup feature continuously backs up logs generated by a cluster, whereas the data backup feature backs up snapshots. Together, the two features can restore data to any point in time after the backup offset.
Log backup
OceanBase Database provides cluster-level log backup capability. Log backup indicates the physical backup of log entries, and the backup data can be compressed and encrypted.
The leader of a partition is responsible for log backup. Each OBServer reads logs from its leader, splits the read logs by partition, and aggregates and sends the logs.
The default log backup interval is 2 minutes. Logs can be backed up in quasi-real time.
In OceanBase Database V2.2.77 and later, the log backup feature can split directories by day to facilitate backup data management.
Data backup
OceanBase Database provides a cluster-level data backup capability. Data backup indicates the backup of data in the form of snapshots by using restore points. This feature ensures the global consistency of data during backup. Data retention consumes additional disk space. If the disk usage level on the OBServer that is used for backup exceeds the specified warning threshold, data backup fails.
RootService schedules the data backup process to send every 1,024 partitions as a group of tasks to OBServers for backup. 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 full metadata and incremental macroblock data. Data restoration 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.
Data cleanup
OceanBase Database enables automatic cleanup for the specified backup path. RootService periodically checks the specified recovery window and deletes unnecessary data backups. RootService determines the backups to be deleted based on the earliest replay offset of the retained data backups.
Secondary backup
Generally, primary backup data is stored on media with high performance. However, this type of backup medium has limited capacity and a short backup retention period. Secondary backup aims to migrate primary backup data to media with larger storage space, a longer retention period, and lower cost.
OceanBase Database provides the secondary backup feature, which helps users schedule OBServers to migrate primary backup data to specified directories. OceanBase Database supports two backup media: OSS and NFS.
Logical backup
OceanBase Database no longer provides cluster-level logical backup in V2.2.7x and later. Instead, OceanBase Database provides OBDUMPER for logical backup. OBDUMPER is a parallel client export tool developed based on Java. It can export data in the SQL or CSV format and supports global filter conditions.