Operations Runbook
This guide covers common operational tasks for running Framework M in production.
1. Scaling the Application
Horizontal Scaling
The Framework M core is stateless and can be scaled horizontally by increasing the number of replicas in your deployment (Docker Compose or Kubernetes).
- See ../deployment/docker for scaling with replicas.
- See ../deployment/kubernetes for HPA (Horizontal Pod Autoscaler) configuration.
Scaling Workers
Background workers can be scaled independently based on queue length. It is recommended to use a dedicated deployment for workers.
2. Database Migrations
Always run migrations before deploying new code that depends on schema changes.
# Apply pending migrations
uv run m migrate
# Check migration status
uv run m migrate:status
See /docs/operations/zero-downtime-migration for ZDM patterns.
3. Backup and Recovery
Database and cache backups are critical for disaster recovery.
- See /docs/operations/backup for database backup/restore procedures.
- See /docs/operations/nats-backup for NATS JetStream persistence.
4. Monitoring and Alerts
Recommended monitoring stack:
- Prometheus: Scrape
/metrics(if implemented). - Grafana: Visualize request latency, error rates, and resource usage.
- Sentry: Capture and track runtime exceptions.