Skip to main content

Backups

Automated database backups and storage object versioning to protect your data and enable point-in-time recovery.

Automated Schedules

Daily, weekly, and monthly backups

One-Click Restore

Restore to any backup point instantly

Storage Versioning

Full version history for every object

Encrypted Storage

Backups encrypted at rest in B2

Overview

The Backup service provides automated protection for your data across two layers: database backups using pg_dump and storage object versioning using B2's S3-compatible versioning API.

Backups are stored in a dedicated B2 bucket (sylphx-backups) separate from your app's storage bucket, ensuring backups survive even if you accidentally delete your storage content.

Database Backups

Database backups use continuous WAL archiving (via WAL-G) to Backblaze B2, plus regular base backups. This enables both snapshot restores and point-in-time recovery (PITR) — meaning you can restore to any second within the retention window, not just daily snapshots.

ScheduleTimeRetentionType
Daily03:00 UTC7 daysAutomatic
WeeklySunday 03:00 UTC30 daysAutomatic
Monthly1st of month90 daysAutomatic
ManualOn demand90 daysUser triggered
Backups are named backups/db/{projectId}/{envId}/{timestamp}.sql.gz in B2. The timestamp uses ISO 8601 format.

Listing Backups

View available backups for a database via the Console or the Management API:

# List available backups for a database
curl -H "Authorization: Bearer slx_cli_YOUR_TOKEN" \
  https://sylphx.com/api/v1/resources/{DB_ID}/backups

# Response:
# {
#   "available": true,
#   "backups": [
#     { "name": "pg-abc123-backup-daily", "status": "completed", "completedAt": "2026-03-09T03:00:00Z" },
#     { "name": "pg-abc123-backup-wal",   "status": "completed", "completedAt": "2026-03-09T11:22:00Z" }
#   ]
# }

Restoring a Backup

Restoring creates a new database from the backup — it does not overwrite the source. Your original database keeps running throughout the restore process.

Restore creates a new DB with a new connectionString. Update your app's env var and redeploy to switch over.
# Point-in-time restore (PITR) — restore to any second in history
curl -X POST https://sylphx.com/api/v1/resources/{DB_ID}/restore \
  -H "Authorization: Bearer slx_cli_YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"targetTime": "2026-03-09T11:30:00Z"}'

# Restores create a NEW database resource — poll it for status:
# GET /api/v1/resources/{restoreId}  →  { "reconcileStatus": "synced", "connectionString": "..." }

# List available CNPG backup snapshots
curl https://sylphx.com/api/v1/resources/{DB_ID}/backups \
  -H "Authorization: Bearer slx_cli_YOUR_TOKEN"
1

Trigger restore via API

Use POST /api/v1/resources/{DB_ID}/restore passing a targetTime (ISO 8601) for point-in-time recovery.
2

Wait for the new database to be ready

Poll GET /api/v1/resources/{restoreId} until reconcileStatus === "synced" (~5 min).
3

Update your app's connection string

Set the new connectionString as your DATABASE_URL env var, then redeploy the app.
4

Delete the old database (optional)

Once verified, delete the original DB via DELETE /api/v1/resources/{oldDbId}.

Storage Versioning

Enable versioning on storage buckets to preserve every version of every object. When versioning is enabled, uploads don't overwrite — they create new versions instead.

versioning.ts
import { Sylphx } from '@sylphx/sdk'

const sylphx = new Sylphx({ secretKey: process.env.SYLPHX_SECRET_KEY })

// Enable versioning on a bucket
await sylphx.storage.enableVersioning('my-bucket')

// List versions for a file
const versions = await sylphx.storage.listVersions('my-bucket', 'uploads/document.pdf')
console.log(versions)
// [
//   { versionId: 'v3', lastModified: '2026-02-21', isLatest: true },
//   { versionId: 'v2', lastModified: '2026-02-20' },
//   { versionId: 'v1', lastModified: '2026-02-19' }
// ]

// Restore a previous version
await sylphx.storage.restoreVersion('my-bucket', 'uploads/document.pdf', 'v2')
Versioning storage is billed like normal storage — each version counts toward your storage quota. Use lifecycle policies to automatically clean up old versions.

Pricing

Backup storage is billed at the same rate as regular B2 storage:

  • Backup storage: $0.025/GB/month
  • Restore operations: Free
  • Manual backups: Free (up to 10/day)
  • Retention: Configurable (default: daily 7d, weekly 30d, monthly 90d)