Database
Nyravio uses PostgreSQL 16 with the pgvector extension for data storage and vector search.
Default configuration
Section titled “Default configuration”The default compose.yaml includes a managed PostgreSQL instance. No external database setup is required for typical deployments.
db: image: pgvector/pgvector:pg16 environment: POSTGRES_DB: ${POSTGRES_DB:-nyravio} POSTGRES_USER: ${POSTGRES_USER:-nyravio} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - pgdata:/var/lib/postgresql/dataData is stored in the pgdata Docker volume and persists across container restarts.
Configuration variables
Section titled “Configuration variables”| Variable | Default | Description |
|---|---|---|
POSTGRES_DB |
nyravio |
Database name |
POSTGRES_USER |
nyravio |
Database user |
POSTGRES_PASSWORD |
(required) | Database password |
External PostgreSQL
Section titled “External PostgreSQL”To use an external PostgreSQL server:
Requirements
Section titled “Requirements”- PostgreSQL 16 (major version must match)
- pgvector extension installed and available
- A dedicated database and user for Nyravio
Setup steps
Section titled “Setup steps”-
Install pgvector on your PostgreSQL server. Refer to the pgvector installation guide.
-
Create the database and user:
CREATE USER nyravio WITH PASSWORD 'your-secure-password';CREATE DATABASE nyravio OWNER nyravio; -
Update your
.envwith the external connection details. -
Modify
compose.yaml— remove or comment out thedbservice and thepgdatavolume. Update the nyravio service environment:services:nyravio:environment:SPRING_DATASOURCE_URL: jdbc:postgresql://your-db-host:5432/nyravioSPRING_DATASOURCE_USERNAME: nyravioSPRING_DATASOURCE_PASSWORD: your-secure-password -
Start Nyravio — Flyway migrations run automatically on first startup and create all required tables and extensions.
Migrations
Section titled “Migrations”Nyravio uses Flyway for database schema management.
- Migrations run automatically on application startup
- Migrations are forward-only — there is no automatic rollback
- The application will not start if any migration fails
- Hibernate DDL auto-generation is disabled (
ddl-auto=none)
If a migration fails:
- Check application logs for the specific error
- Restore from backup if needed (see Recovery)
- Report the issue with the migration error message
Connection pool
Section titled “Connection pool”The default connection pool settings (HikariCP):
| Setting | Default |
|---|---|
| Maximum pool size | 30 |
| Minimum idle | 10 |
| Connection timeout | 30,000 ms |
| Max lifetime | 1,800,000 ms (30 min) |
These defaults are suitable for most deployments.
Backup
Section titled “Backup”Database backups are critical. See Backup for the complete procedure including integrity verification.
Next steps
Section titled “Next steps”- Backup — database backup procedures
- Recovery — restore from backup
- Environment Variables — full configuration reference