vortos/vortos-backup
Composer 安装命令:
composer require vortos/vortos-backup
包简介
Vortos Backup — enterprise-grade database backups: streamed pg_dump/pg_basebackup + WAL PITR and mongodump to an object store (R2), integrity-verified at creation, append-only catalog, GFS retention with hard safety floors, encryption-ready stream seam (Block 20), and a Block-17-ready alerting event
README 文档
README
Enterprise-grade database backups for the Vortos platform (Deploy/CI-CD Block 19).
dump → store → verify → catalog → retain, versioned and scheduled, behind the
OpsKit swappable-driver pattern. The reference stack backs up Postgres + Mongo to
Cloudflare R2 via the existing object store — but no provider name appears outside a
Driver/ namespace.
Concerns (two ports)
| Port | Drivers (in-core) | Selected by |
|---|---|---|
Port\BackupTargetInterface (dump source) |
postgres, mongo |
#[AsDriver] key |
Port\BackupStoreInterface (destination) |
object-store |
#[AsDriver] key |
Both extend OpsKit\DriverInterface, so every driver reports a CapabilityDescriptor
validated at config time and asserted by the TCK (Testing\*ConformanceTestCase).
Guarantees
- Streamed, bounded memory. Dumps flow process → store via multipart; the checksum
is computed in the same pass (
Service\ChecksumStreamFilter). No whole-artifact buffering; no plaintext dump on a tracked/persistent disk path. - Verified at creation.
Service\IntegrityVerifierreads the stored object back, re-checks the checksum (constant-time) and sniffs the format magic. A corrupt or truncated dump fails loudly and is never cataloged as good. A mid-stream subprocess failure is caught byService\Process\ProcessGuardafter the bytes are consumed. - Append-only catalog.
Catalog\Dbal*INSERTs once; a DB trigger rejects UPDATE (DELETE is permitted only for retention). - Safe retention.
Domain\RetentionPolicyis GFS with a hardminKeepFloorand a "never delete the most-recent" guard; dry-run is the default (backup:retention),--applyrequired to delete. WAL is pruned by the PITR invariant (kept iff ≥ the oldest retained base backup). - Full PITR.
pg_basebackupbase backups + WAL shipping (Pitr\PostgresWalArchiver, idempotent).Pitr\PitrPreflightfails closed when the host isn't configured.
Block boundaries
- Block 17 (
vortos-alerts) — not required. Backup events broadcast onEvent\BackupEventSinkInterface(logging default). A failed/integrity-failed backup is aCriticalevent; Block 17 registers an alerting sink via thevortos.backup.event_sinktag — zero changes here. - Block 20 (encryption/3-2-1/object-lock/drills) — additive. At-rest envelope
encryption slots into
Service\EncryptionSeam\StreamTransformInterface(today an identity transform); immutability/cross-region are already declared store capabilities (honestlyfalsefor now).
Host wiring (operator)
- Schedule:
backup:scheduleemits a managed cron fragment that invokesbackup:run. The framework runs no scheduler. - PITR: set
archive_mode=on,wal_level=replica, andarchive_command = 'vortos backup:wal-archive %p --env=prod'on the host. Verify withPitr\PitrPreflight.
Environment
| Var | Default | Purpose |
|---|---|---|
VORTOS_BACKUP_STORE |
object-store |
store driver key |
VORTOS_BACKUP_KEY_PREFIX |
backups |
object key prefix |
VORTOS_BACKUP_LOCK_DIR |
<project>/var/backup-locks |
single-flight locks |
VORTOS_BACKUP_MONGO_URI |
(empty) | mongodump --uri |
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-25