Skip to content

[Backend] Automated Database Backup & Disaster Recovery Verification Pipeline #1326

Description

@blurbeast

Overview & Background

FlowFi stores indexed stream states, event histories, and user webhook configurations. To prevent data loss and ensure rapid disaster recovery, an automated encrypted backup pipeline with periodic restoration verification in CI is required.


Technical Specification & Architecture

  1. Backup Script (scripts/db-backup.sh):
    • Perform atomic pg_dump with gzip compression.
    • Encrypt backup archive using AES-256-GCM.
    • Upload backup artifact to S3 / Cloud Storage with 30-day retention policy.
  2. Disaster Recovery Validation Job (.github/workflows/dr-test.yml):
    • Scheduled weekly CI workflow that spins up a clean Postgres container.
    • Downloads the latest encrypted backup, decrypts, and restores it.
    • Runs Prisma schema verification and row count integrity assertions.

Target Files

  • scripts/db-backup.sh
  • scripts/db-restore.sh
  • .github/workflows/dr-test.yml

Acceptance Criteria

  • Encrypted automated backup script with cloud storage destination.
  • Weekly disaster recovery CI workflow restores backup and validates DB integrity.
  • Documentation added for disaster recovery procedures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions