Disaster Recovery
Disaster Recovery protocol schemas
Backup Strategy Schema
Defines backup methods for disaster recovery.
- full: Complete snapshot of all data
- incremental: Only changes since last backup
- differential: All changes since last full backup
@example
const backup: BackupConfig = {
strategy: 'incremental',
schedule: '0 2 * * *',
retention: { days: 30, minCopies: 3 },
encryption: { enabled: true, algorithm: 'AES-256-GCM' },
};Source: packages/spec/src/system/disaster-recovery.zod.ts
TypeScript Usage
import { BackupConfigSchema, BackupRetentionSchema, BackupStrategySchema, DisasterRecoveryPlanSchema, FailoverConfigSchema, FailoverModeSchema, RPOSchema, RTOSchema } from '@objectstack/spec/system';
import type { BackupConfig, BackupRetention, BackupStrategy, DisasterRecoveryPlan, FailoverConfig, FailoverMode, RPO, RTO } from '@objectstack/spec/system';
// Validate data
const result = BackupConfigSchema.parse(data);BackupConfig
Backup configuration
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| strategy | Enum<'full' | 'incremental' | 'differential'> | optional | Backup strategy |
| schedule | string | { dialect: Enum<'cel' | 'cron' | 'template'>; source?: string; ast?: any; meta?: object } | optional | Cron expression for backup schedule — cron0 2 * * * |
| retention | { days: number; minCopies?: number; maxCopies?: number } | ✅ | Backup retention policy |
| destination | { type: Enum<'s3' | 'gcs' | 'azure_blob' | 'local'>; bucket?: string; path?: string; region?: string } | ✅ | Backup storage destination |
| encryption | { enabled?: boolean; algorithm?: Enum<'AES-256-GCM' | 'AES-256-CBC' | 'ChaCha20-Poly1305'>; keyId?: string } | optional | Backup encryption settings |
| compression | { enabled?: boolean; algorithm?: Enum<'gzip' | 'zstd' | 'lz4' | 'snappy'> } | optional | Backup compression settings |
| verifyAfterBackup | boolean | optional | Verify backup integrity after creation |
BackupRetention
Backup retention policy
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| days | number | ✅ | Retention period in days |
| minCopies | number | ✅ | Minimum backup copies to retain |
| maxCopies | number | optional | Maximum backup copies to store |
BackupStrategy
Backup strategy type
Allowed Values
fullincrementaldifferential
DisasterRecoveryPlan
Complete disaster recovery plan configuration
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | boolean | optional | Enable disaster recovery plan |
| rpo | { value: number; unit?: Enum<'seconds' | 'minutes' | 'hours'> } | ✅ | Recovery Point Objective |
| rto | { value: number; unit?: Enum<'seconds' | 'minutes' | 'hours'> } | ✅ | Recovery Time Objective |
| backup | { strategy?: Enum<'full' | 'incremental' | 'differential'>; schedule?: string | object; retention: object; destination: object; … } | ✅ | Backup configuration |
| failover | { mode?: Enum<'active_passive' | 'active_active' | 'pilot_light' | 'warm_standby'>; autoFailover?: boolean; healthCheckInterval?: number; failureThreshold?: number; … } | optional | Multi-region failover configuration |
| replication | { mode?: Enum<'synchronous' | 'asynchronous' | 'semi_synchronous'>; maxLagSeconds?: number; includeObjects?: string[]; excludeObjects?: string[] } | optional | Data replication settings |
| testing | { enabled?: boolean; schedule?: string | object; notificationChannel?: string } | optional | Automated disaster recovery testing |
| runbookUrl | string | optional | URL to disaster recovery runbook/playbook |
| contacts | { name: string; role: string; email?: string; phone?: string }[] | optional | Emergency contact list for DR incidents |
FailoverConfig
Failover configuration
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| mode | Enum<'active_passive' | 'active_active' | 'pilot_light' | 'warm_standby'> | ✅ | Failover mode |
| autoFailover | boolean | ✅ | Enable automatic failover |
| healthCheckInterval | number | ✅ | Health check interval in seconds |
| failureThreshold | number | ✅ | Consecutive failures before failover |
| regions | { name: string; role: Enum<'primary' | 'secondary' | 'witness'>; endpoint?: string; priority?: number }[] | ✅ | Multi-region configuration (minimum 2 regions) |
| dns | { ttl: number; provider?: Enum<'route53' | 'cloudflare' | 'azure_dns' | 'custom'> } | optional | DNS failover settings |
FailoverMode
Failover mode
Allowed Values
active_passiveactive_activepilot_lightwarm_standby
RPO
Recovery Point Objective (maximum acceptable data loss)
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| value | number | ✅ | RPO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | ✅ | RPO time unit |
RTO
Recovery Time Objective (maximum acceptable downtime)
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| value | number | ✅ | RTO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | ✅ | RTO time unit |