@restoreverify/mariadb
v0.2.4
Published
Verify every backup. Recover with confidence. Enterprise-grade database point-in-time recovery (PITR) and verification.
Readme
@restoreverify/mariadb
Database adapter for MariaDB in the RestoreVerify ecosystem.
RestoreVerify is an enterprise-grade, open source database point-in-time recovery (PITR) and verification tool.
This package provides the core adapter for MariaDB to execute backups, restores, and verification drills programmatically via physical backups and binlog replay.
Installation
npm install @restoreverify/mariadb @restoreverify/core(Alternatively, you can install the unified restoreverify package which includes all adapters).
Functions
This adapter implements the standard RestoreVerify adapter interface:
backup(config): Initiates a physical backup usingmariabackup.restore(config): Restores the backup to a specific point-in-time by preparing and restoring the data directory, then replaying binlogs.verify(config): Connects to MariaDB and runs queries to ensure data integrity.validateBackup(config): Validates the backup files and binlogs on disk.
Code Snippet Usage
import { mariadbAdapter } from '@restoreverify/mariadb';
import { LocalBinaryStrategy, DockerExecStrategy } from '@restoreverify/core';
// Example: Backup a MariaDB database locally
async function performBackup() {
const result = await mariadbAdapter.backup({
connectionString: 'mariadb://root:password@localhost:3306/mydb',
backupDir: '/mnt/backups/mariadb',
walDir: '/mnt/binlogs/mariadb',
// Choose your execution strategy (Local, Docker, Kubernetes, SSH)
strategy: new LocalBinaryStrategy()
});
if (result.success) {
console.log(`Backup completed successfully! ID: ${result.backupId}`);
} else {
console.error(`Backup failed: ${result.error}`);
}
}
performBackup();Author
Avisekh Kumar Tewari
GitHub: https://github.com/Avisekh02
