---
title: Disaster Recovery
description: Disaster Recovery protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

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

```typescript

const backup: BackupConfig = \{

strategy: 'incremental',

schedule: '0 2 * * *',

retention: \{ days: 30, minCopies: 3 \},

encryption: \{ enabled: true, algorithm: 'AES-256-GCM' \},

\};

```

<Callout type="info">
**Source:** `packages/spec/src/system/disaster-recovery.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { BackupRetention, BackupStrategy, FailoverConfig, FailoverMode, RPO, RTO } from '@objectstack/spec/system';
import type { BackupRetention, BackupStrategy, FailoverConfig, FailoverMode, RPO, RTO } from '@objectstack/spec/system';

// Validate data
const result = BackupRetention.parse(data);
```

---

## 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

* `full`
* `incremental`
* `differential`


---

## 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** | `Object[]` | ✅ | Multi-region configuration (minimum 2 regions) |
| **dns** | `Object` | optional | DNS failover settings |


---

## FailoverMode

Failover mode

### Allowed Values

* `active_passive`
* `active_active`
* `pilot_light`
* `warm_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 |


---

