Production: sizing, HA, backup & upgrades¶
Run Vex Raptor reliably for a team or a client book. This page covers capacity, availability, data durability, and safe upgrades. For the base install see Docker Compose.
Architecture¶
A production deployment runs five roles:
| Service | Role | Scale by |
|---|---|---|
| API | HTTP + SSE, auth, orchestration | Replicas behind your proxy |
| Worker | Runs scans (ARQ jobs) | Add workers for scan throughput |
| PostgreSQL | System of record | Vertical + managed HA |
| Redis | Queue, quota, shared scan state | Managed/replicated |
| Web | Static console | Replicas / CDN |
Redis is what lets multiple API/worker replicas agree on quota and scan state — it is required for horizontal scaling.
Sizing¶
Start here and adjust from real metrics:
| Deployment | API | Workers | PostgreSQL | Redis |
|---|---|---|---|---|
| Lab / eval | 1 vCPU / 1 GB | shared | SQLite/1 GB | optional |
| Small team | 2 vCPU / 2 GB | 1–2 | 2 vCPU / 4 GB | 1 GB |
| MSSP / heavy | 2+ replicas | N per concurrency target | managed, 4+ vCPU | managed HA |
Scan concurrency is bounded by worker count and the per-target rate cap. Add workers to raise throughput; raising the rate cap risks disrupting targets.
High availability¶
- Run 2+ API replicas and 2+ workers across availability zones.
- Use managed PostgreSQL with automated failover and PITR.
- Use managed/replicated Redis.
- Health probe:
GET /health(unversioned, no auth) for load-balancer checks.
Backup & restore¶
Back up PostgreSQL (system of record) and your report storage. Redis is ephemeral (queue/quota/state) and does not require backup.
# Backup
pg_dump "$DATABASE_URL" | gzip > vex-$(date +%F).sql.gz
# Restore into a fresh database
gunzip -c vex-2026-07-09.sql.gz | psql "$DATABASE_URL"
Never destroy the data volume
docker compose down -v deletes the PostgreSQL volume. Use down (without
-v) to stop the stack. Test restores regularly — an untested backup is a
hope, not a backup.
Upgrades & migrations¶
- Read the release notes for breaking changes.
- Back up PostgreSQL first.
-
Pull the new image and apply database migrations:
-
Verify
GET /healthand run a smoke scan against a lab target.
Roll back by redeploying the previous image tag; restore the DB backup only if a migration must be reverted.
Pin image tags
Deploy specific version tags (not latest) so replicas are identical and
rollbacks are deterministic.