restoreverify
v0.2.4
Published
Enterprise PostgreSQL point-in-time recovery and restore verification platform
Downloads
781
Maintainers
Readme
RestoreVerify
Verify every backup. Recover with confidence.
RestoreVerify is an enterprise-grade, open source database point-in-time recovery (PITR) and verification tool. It provides a standardized API and CLI to backup, restore, and verify databases securely and reliably.
Why RestoreVerify?
Most backup tools focus on taking the backup. RestoreVerify focuses on proving you can restore it. It orchestrates the entire lifecycle: backing up the database, spinning up a sandbox environment, restoring the data to a specific point in time, and running verification checks to ensure data integrity.
- Universal Interface: The exact same CLI and SDK commands work across PostgreSQL, MySQL, MariaDB, and SQLite.
- Execution Strategies: Run commands locally, inside Docker, or via Kubernetes — the adapter handles the database, the strategy handles the execution.
- Proof of Recovery: RestoreVerify doesn't just create files; it runs automated restore drills and generates reports.
Supported Databases (v0.2.0)
- PostgreSQL (12 - 16) - True PITR via
pg_basebackup+ WAL Archive Replay - MySQL (8.0, 8.4) - True PITR via Logical Dump + Binlog Replay
- MariaDB (10.6, 11.4) - True PITR via Physical Backup + Binlog Replay
- SQLite (3.x) - Full file backup via Online Backup API
🚀 Quick Start (CLI)
1. Installation
Install the unified restoreverify package globally to use the rv command:
npm install -g restoreverify2. Verify Environment
Ensure your local environment has the necessary tools (like Docker or DB clients):
rv doctor3. Create a Backup
Take a backup of your local database. By default, it uses the local execution strategy.
export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
export BACKUP_DIR="/tmp/backups"
export WAL_DIR="/tmp/wal"
rv backup -d postgresql4. Verify the Backup
Run a restore drill. This will spin up a sandbox environment (e.g., a Docker container), restore the backup, and run verification queries.
rv verify -d postgresql --docker postgres:15 -q "SELECT 1"💻 SDK Usage (Code Snippets)
RestoreVerify can be consumed programmatically in your own Node.js applications.
Installation
npm install restoreverifyFunctions Overview
All database adapters (postgresAdapter, mysqlAdapter, mariadbAdapter, sqliteAdapter) implement the same core interface:
backup(config): Backs up the database.restore(config): Restores the database to a specific time.verify(config): Connects to the restored database and executes validation queries.validateBackup(config): Checks backup files on disk for integrity.
Example: Programmatic Backup
import { postgresAdapter, LocalBinaryStrategy, DockerExecStrategy } from 'restoreverify';
async function runBackup() {
const result = await postgresAdapter.backup({
connectionString: 'postgresql://postgres:password@localhost:5432/mydb',
backupDir: '/mnt/backups',
walDir: '/mnt/wal',
// Run the backup command inside an existing Docker container!
// Or use `new LocalBinaryStrategy()` to run on the host.
strategy: new DockerExecStrategy('my-postgres-container')
});
if (result.success) {
console.log(`Backup succeeded! ID: ${result.backupId}`);
} else {
console.error('Backup failed:', result.error);
}
}
runBackup();Execution Strategies
RestoreVerify decouples what to execute (the database adapter) from how to execute it (the execution strategy).
LocalBinaryStrategy: Runs commands directly on the host machine.DockerExecStrategy: Runs commands inside a Docker container viadocker exec.KubernetesExecStrategy: Runs commands inside a K8s Pod viakubectl exec.SshStrategy: Runs commands on a remote server viassh.
Author
Avisekh Kumar Tewari
GitHub: https://github.com/Avisekh02
License
MIT License.
