Disaster Recovery
Disaster Recovery protocol schemas
Source: packages/spec/src/system/disaster-recovery.zod.ts
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);
Backup configuration
| Property | Type | Required | Description |
|---|
| strategy | Enum<'full' | 'incremental' | 'differential'> | optional (default: "incremental") | 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 (default: true) | Verify backup integrity after creation |
| Property | Type | Required | Description |
|---|
| days | number | ✅ | Retention period in days |
| minCopies | number | optional (default: 3) | Minimum backup copies to retain |
| maxCopies | number | optional | Maximum backup copies to store |
| Property | Type | Required | Description |
|---|
| type | Enum<'s3' | 'gcs' | 'azure_blob' | 'local'> | ✅ | Storage backend type |
| bucket | string | optional | Cloud storage bucket/container name |
| path | string | optional | Storage path prefix |
| region | string | optional | Cloud storage region |
| Property | Type | Required | Description |
|---|
| enabled | boolean | optional (default: true) | Enable backup encryption |
| algorithm | Enum<'AES-256-GCM' | 'AES-256-CBC' | 'ChaCha20-Poly1305'> | optional (default: "AES-256-GCM") | Encryption algorithm |
| keyId | string | optional | KMS key ID for encryption |
| Property | Type | Required | Description |
|---|
| enabled | boolean | optional (default: true) | Enable backup compression |
| algorithm | Enum<'gzip' | 'zstd' | 'lz4' | 'snappy'> | optional (default: "zstd") | Compression algorithm |
Backup retention policy
| Property | Type | Required | Description |
|---|
| days | number | ✅ | Retention period in days |
| minCopies | number | optional (default: 3) | Minimum backup copies to retain |
| maxCopies | number | optional | Maximum backup copies to store |
Backup strategy type
full
incremental
differential
Complete disaster recovery plan configuration
| Property | Type | Required | Description |
|---|
| enabled | boolean | optional (default: false) | 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 |
| Property | Type | Required | Description |
|---|
| value | number | ✅ | RPO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | optional (default: "minutes") | RPO time unit |
| Property | Type | Required | Description |
|---|
| value | number | ✅ | RTO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | optional (default: "minutes") | RTO time unit |
| Property | Type | Required | Description |
|---|
| strategy | Enum<'full' | 'incremental' | 'differential'> | optional (default: "incremental") | 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 (default: true) | Verify backup integrity after creation |
| Property | Type | Required | Description |
|---|
| mode | Enum<'active_passive' | 'active_active' | 'pilot_light' | 'warm_standby'> | optional (default: "active_passive") | Failover mode |
| autoFailover | boolean | optional (default: true) | Enable automatic failover |
| healthCheckInterval | number | optional (default: 30) | Health check interval in seconds |
| failureThreshold | number | optional (default: 3) | 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 |
| Property | Type | Required | Description |
|---|
| mode | Enum<'synchronous' | 'asynchronous' | 'semi_synchronous'> | optional (default: "asynchronous") | Data replication mode |
| maxLagSeconds | number | optional | Maximum acceptable replication lag in seconds |
| includeObjects | string[] | optional | Objects to replicate (empty = all) |
| excludeObjects | string[] | optional | Objects to exclude from replication |
| Property | Type | Required | Description |
|---|
| enabled | boolean | optional (default: false) | Enable automated DR testing |
| schedule | string | { dialect: Enum<'cel' | 'cron' | 'template'>; source?: string; ast?: any; meta?: object } | optional | Cron expression for DR test schedule |
| notificationChannel | string | optional | Notification channel for DR test results |
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Contact name |
| role | string | ✅ | Contact role (e.g., "DBA", "SRE Lead") |
| email | string | optional | Contact email |
| phone | string | optional | Contact phone |
Failover configuration
| Property | Type | Required | Description |
|---|
| mode | Enum<'active_passive' | 'active_active' | 'pilot_light' | 'warm_standby'> | optional (default: "active_passive") | Failover mode |
| autoFailover | boolean | optional (default: true) | Enable automatic failover |
| healthCheckInterval | number | optional (default: 30) | Health check interval in seconds |
| failureThreshold | number | optional (default: 3) | 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 |
| Property | Type | Required | Description |
|---|
| name | string | ✅ | Region identifier (e.g., "us-east-1", "eu-west-1") |
| role | Enum<'primary' | 'secondary' | 'witness'> | ✅ | Region role |
| endpoint | string | optional | Region endpoint URL |
| priority | number | optional | Failover priority (lower = higher priority) |
| Property | Type | Required | Description |
|---|
| ttl | number | optional (default: 60) | DNS TTL in seconds for failover |
| provider | Enum<'route53' | 'cloudflare' | 'azure_dns' | 'custom'> | optional | DNS provider for automatic failover |
Failover mode
active_passive
active_active
pilot_light
warm_standby
Recovery Point Objective (maximum acceptable data loss)
| Property | Type | Required | Description |
|---|
| value | number | ✅ | RPO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | optional (default: "minutes") | RPO time unit |
Recovery Time Objective (maximum acceptable downtime)
| Property | Type | Required | Description |
|---|
| value | number | ✅ | RTO value |
| unit | Enum<'seconds' | 'minutes' | 'hours'> | optional (default: "minutes") | RTO time unit |