Files
madbase/docs/STORAGE.md
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

38 lines
1.3 KiB
Markdown

# MadBase Storage & Persistence
MadBase uses a tiered storage approach combining local persistence, distributed databases, and S3-compatible object storage.
## 1. Local Block Storage
Nodes use local NVMe/SSD storage for high-performance service data:
- **Database**: PostgreSQL data stored in `/var/lib/postgresql/data`.
- **Metrics**: VictoriaMetrics data stored in `/victoria-metrics-data`.
- **Logs**: Loki chunks stored in `/loki`.
## 2. Object Storage (S3)
Used for backups, static assets, and long-term state retention.
- **Backups**: Database backups are automatically piped to S3-compatible buckets.
- **Provider**: Works with Hetzner Bucket Storage, AWS S3, or MinIO.
### Configuration
```bash
S3_ENDPOINT="https://fsn1.your-storage-endpoint.com"
S3_ACCESS_KEY="your_key"
S3_SECRET_KEY="your_secret"
S3_BUCKET="madbase-backups"
```
## 3. Backup & Restore
### Manual Backup
```bash
curl -X POST http://localhost:8001/api/v1/cluster/database/backup
```
### Manual Restore
```bash
curl -X POST http://localhost:8001/api/v1/cluster/database/restore \
-d '{"backup_url": "s3://..."}'
```
## 4. Planning & Capacity
- **DB Nodes**: Scale vertically (RAM) for active datasets; scale horizontally (Nodes) for read-throughput and HA.
- **Retention**: Configure VictoriaMetrics and Loki retention periods in the System Node config to manage disk usage.