Merge branch 'worktree-landing-backup'
# Conflicts: # CHANGELOG.md
This commit is contained in:
@@ -98,6 +98,27 @@ analytics.duckdb ← serving tables only, web app read-only
|
||||
└── serving.* ← atomically replaced by export_serving.py
|
||||
```
|
||||
|
||||
## Backup & disaster recovery
|
||||
|
||||
| Data | Tool | Target | Frequency |
|
||||
|------|------|--------|-----------|
|
||||
| `app.db` (auth, billing) | Litestream | R2 `padelnomics/app.db` | Continuous (WAL) |
|
||||
| `.state.sqlite` (extraction state) | Litestream | R2 `padelnomics/state.sqlite` | Continuous (WAL) |
|
||||
| `data/landing/` (JSON.gz files) | rclone sync | R2 `padelnomics/landing/` | Every 30 min (systemd timer) |
|
||||
| `lakehouse.duckdb`, `analytics.duckdb` | N/A (derived) | Re-run pipeline | On demand |
|
||||
|
||||
Recovery:
|
||||
```bash
|
||||
# App database (auto-restored by Litestream container on startup)
|
||||
litestream restore -config /etc/litestream.yml /app/data/app.db
|
||||
|
||||
# Extraction state (auto-restored by Litestream container on startup)
|
||||
litestream restore -config /etc/litestream.yml /data/landing/.state.sqlite
|
||||
|
||||
# Landing zone files
|
||||
source /opt/padelnomics/.env && bash infra/restore_landing.sh
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|
||||
Reference in New Issue
Block a user