Skip to main content

Overview

S2 Lite stores all data in object storage through SlateDB. This guide covers backup strategies, disaster recovery, and data migration approaches.

Understanding S2 Lite Storage

Storage Architecture

S2 Lite uses SlateDB which stores data entirely in object storage:
All data is organized under the --path prefix you specify when running S2 Lite.

Data Model

SlateDB organizes S2 data using these key prefixes:
  • Basin metadata: /basin/{name}/meta
  • Stream metadata: /stream/{basin}/{stream}/meta
  • Stream records: /stream/{basin}/{stream}/records/{seq}
  • Stream tail positions: /stream/{basin}/{stream}/tail
  • Fencing tokens: /stream/{basin}/{stream}/fence
See lite/src/backend/kv/mod.rs for the complete data model.

Backup Strategies

Strategy 1: Object Storage Native Backups

Recommended for most deployments. Leverage your object storage provider’s built-in backup features.

AWS S3 Versioning + Lifecycle

1

Enable S3 versioning

This preserves all versions of objects, protecting against accidental deletions.
2

Configure lifecycle policy

3

Test recovery

List object versions:
Restore a specific version:

S3 Replication (Cross-Region)

1

Create destination bucket

2

Create replication IAM role

3

Configure replication

Cloudflare R2 Replication

Cloudflare R2 doesn’t support automatic replication yet, but you can use object lifecycle policies:

Tigris Automatic Backups

Tigris provides automatic multi-region replication and point-in-time recovery. No additional configuration needed.

Strategy 2: Snapshot-Based Backups

Create point-in-time snapshots by copying the entire S2 Lite path:
1

Create snapshot script

2

Schedule with CronJob

3

Create IAM role for backup job

Strategy 3: Stream-Level Backups

Export individual streams to separate storage:
1

Export stream to file

2

Automated export script

Stream-level backups require reading all data through S2 Lite, which may impact performance and incur costs.

Restore Procedures

Restore from Object Storage Backup

Full Restore

1

Stop S2 Lite

2

Restore from backup

3

Start S2 Lite

4

Verify data

Point-in-Time Recovery

Recover to a specific point in time using S3 versioning:

Restore Individual Streams

1

Import stream from backup

2

Create stream

3

Append records

This restores data but not the original sequence numbers. Use object storage backups for exact recovery.

Cross-Region Failover

Switch to a replica bucket in another region:
1

Update S2 Lite configuration

2

Upgrade deployment

3

Verify failover

Data Migration

Migrate Between Object Stores

Move S2 Lite data from one object storage provider to another:
1

Stop S2 Lite

2

Copy data to new bucket

3

Update S2 Lite configuration

4

Start S2 Lite with new bucket

5

Verify migration

Blue-Green Migration

Zero-downtime migration strategy:
1

Copy data to new bucket

While S2 Lite is running:
2

Deploy new S2 Lite (green)

3

Switch traffic

Update DNS or load balancer to point to green deployment.
4

Cleanup old deployment

Disaster Recovery Plan

RTO and RPO Targets

DR Checklist

1

Document configuration

  • Record bucket names, regions, endpoints
  • Save Helm values files in version control
  • Document IAM roles and policies
  • List all basins and critical streams
2

Enable backups

  • Enable S3 versioning
  • Configure lifecycle policies
  • Set up cross-region replication (critical deployments)
  • Schedule snapshot backups
3

Test recovery procedures

  • Perform quarterly restore tests
  • Validate backup integrity
  • Measure actual RTO/RPO
  • Update runbooks based on results
4

Monitor backup status

  • Set up alerts for replication lag
  • Monitor backup job failures
  • Track backup storage costs

Emergency Recovery Runbook

  1. Assess the situation
    • Identify scope of data loss
    • Determine last known good state
    • Choose recovery strategy
  2. Stop S2 Lite
  3. Restore data (choose one)
    • S3 versioning: Restore specific versions
    • Replication: Switch to replica bucket
    • Snapshot: Sync from backup path
  4. Restart S2 Lite
  5. Verify recovery
    • Check health endpoint
    • List basins and streams
    • Validate critical data
    • Test write operations
  6. Document incident
    • Record timeline
    • Note data loss (if any)
    • Update procedures

Cost Optimization

Storage Class Strategies

Backup Retention

Next Steps

Production Deployment

Review production deployment best practices

S3 Setup

Configure object storage providers