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
- 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.
- 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
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
scripts/db-backup.sh):pg_dumpwith gzip compression..github/workflows/dr-test.yml):Target Files
scripts/db-backup.shscripts/db-restore.sh.github/workflows/dr-test.ymlAcceptance Criteria