Developer beta 0.1.0-beta.1 documentation. The build is not available for download yet; these pages describe the beta as built and tested on Linux x86-64.
Backup
holadb backup ./shop ./backups/shop-2026-09-25 # offline, full
holadb backup ./shop ./backups/shop-2026-09-26 --base ./backups/shop-2026-09-25 # offline, incremental
holadb snapshot holadb://admin:pw@db1:7433 /backups/shop-2026-09-27 # online, from a running server
holadb verify-backup ./backups/shop-2026-09-26
A backup is a directory:
shop-2026-09-25/
BACKUP_MANIFEST.json format version, time, database id, schema version, tables,
every file with size and SHA-256, the chain of base backups,
a hash over the file list, the commit position (online)
BACKUP_COMPLETE the completion marker: names the manifest's SHA-256;
written last, after everything else is on disk
files/ a copy of every database file (or, incrementally, a reference)
Offline and online
- Offline (
holadb backup <dir> <dest>): the server must be stopped. The backup takes the database’s process lock and only reads the directory — no recovery, no rewrite of any file; a database another process holds is refused. - Online (
holadb snapshot <holadb://addr> <dest> [--base <b>]): a running server takes it. The paths are on the server’s machine. The server holds its database for well under a millisecond to capture a consistent point between commits (every commit acknowledged before it is in the backup, none after it, every multi-table transaction whole), then copies without blocking writers. The result reports the commit position the backup holds and how long the database was held.
Guarantees
- Durable and atomic. Files are written into
<dest>.partialandfsynced, the directoriesfsynced, then the manifest, then the completion marker, then the directory is renamed into place and the rename made durable. A backup that was interrupted at any point — a crash, a full disk, an I/O error — is never published, and an interrupted one is refused byverify-backupandrestore(… is incomplete: it has a manifest but no BACKUP_COMPLETE marker). The next backup to the same destination cleans up and succeeds. - Verified. Every file is hashed with SHA-256 before and while it is
copied (a file that changes during the copy is refused);
verify-backupre-reads everything, including the base backups of an incremental one. - Independent of the network protocol. A backup is files and a JSON manifest; it needs no server to be read.
Incremental backups
With --base <previous backup>, a file whose size and SHA-256 match one in
the base (or the base’s own bases) is not copied again. Sealed storage
segments are immutable, so a database that mostly grows shares most of its
bytes across backups.
The manifest references each base by a relative path (../shop-2026-09-25)
and records the SHA-256 of that base’s manifest. Move or copy a whole
chain anywhere — another directory, another machine — and it verifies and
restores unchanged. A base that is missing, damaged, incomplete, of another
database, or replaced by a different backup under the same name is
reported by name; nothing is restored from such a chain.
Keep the base backups: deleting a base breaks every backup that references
it. verify-backup tells you exactly which.
Write-ahead-log archiving (point-in-time recovery)
holadb serve ./shop --archive /archive/shop-gen7 --archive-interval-ms 60000
holadb archive holadb://admin:pw@db1:7433 # one step now
holadb verify-archive /archive/shop-gen7
With --archive, the server copies every table’s write-ahead log and the
transaction journal into the archive directory every interval (and on
holadb archive), at a point between commits. Together with a backup
taken before, the archive restores the database to the last archived
commit or to any earlier commit (see Restore).
Recovery point objective. A commit acknowledged after the last completed archive step is not in the archive: if the database directory is lost, the archive gives back everything up to that step and nothing after it. The RPO is the interval plus the time one step takes (typically well under a second). There is no zero-data-loss mode.
The archive carries data, not schema: a point-in-time restore stops before
the first CREATE/DROP/ALTER after its base backup. Take a new base
backup after a schema change.
Retention policy
- Keep at least two full base backups; take an online snapshot at least daily.
- Use one archive directory per base generation: after a new full base
backup, restart the server with
--archivepointing at a new directory. Delete an old archive directory only together with the base backups that need it. An archive cannot be pruned in place. - Run
verify-backupandverify-archivedaily and a restore drill weekly. - The archive grows by every byte of log written. The database directory
keeps the logs each checkpoint seals (
wal-sealed-…) until a step has archived them, so if archive steps keep failing (logged asarchive step failed) the database directory grows.
What is not in a backup
The LOCK file, temporary files and the sealed logs kept for the archive.
Users and roles (AUTH.json) are included.
Automating
#!/bin/sh
set -e
d=/backups/shop-$(date -u +%Y%m%dT%H%M%SZ)
holadb snapshot "holadb://backup:$PW@db1:7433" "$d" --base "$(ls -d /backups/shop-* | tail -1)"
holadb verify-backup "$d"
Backups written before this version (format 1) are still verified and restored; their manifest was their completion record.