Skip to main content

Module backup

Module backup 

Source
Expand description

Incremental backup and point-in-time recovery.

Provides backup_full(), backup_incremental(), and restore_to_epoch() APIs on GrafeoDB. Full backups capture the entire database state; incremental backups export only the WAL records since the last backup. Recovery replays a chain of full + incremental backups to restore the database to any committed epoch.

§Backup chain model

[Full Snapshot] -> [Incr 1] -> [Incr 2] -> ... -> [Incr N]
  epoch 0-100      101-200     201-300              901-1000

To restore to epoch 750: load full snapshot (epoch 100), replay incrementals 1-7, stop at epoch 750.

Structs§

BackupCursor
Tracks the WAL position of the last completed backup.
BackupManifest
Tracks the full backup chain for a database.
BackupSegment
Metadata for a single backup segment (full or incremental).

Enums§

BackupKind
The type of a backup segment.

Constants§

BACKUP_HEADER_SIZE
Header for an incremental backup file.
BACKUP_MAGIC
Magic bytes for incremental backup files.
BACKUP_VERSION
Current backup file version.

Functions§

read_backup_cursor
Reads the backup cursor from a WAL directory.
read_backup_header
Reads and validates the incremental backup file header.
read_manifest
Reads the backup manifest from a backup directory.
write_backup_cursor
Writes the backup cursor to a WAL directory.
write_backup_header
Writes the incremental backup file header.
write_manifest
Writes the backup manifest to a backup directory.