UPNEXT_BACKEND or upnext server start --backend. Valid values are redis, sqlite, and postgres.
Backend comparison
| Backend | Set UPNEXT_BACKEND | Persistent store | UPNEXT_DATABASE_URL | Migrations |
|---|---|---|---|---|
| Redis | redis | Redis keys | Ignored for persistence | Not used |
| SQLite | sqlite | SQLite file | Optional (defaults to sqlite+aiosqlite:///upnext.db) | Auto-creates tables at startup |
| PostgreSQL | postgres | PostgreSQL | Required | Required before startup |
Startup and migration matrix
| Backend | Required env | Startup behavior |
|---|---|---|
| Redis | UPNEXT_BACKEND=redis, UPNEXT_REDIS_URL | Server starts without SQL migrations |
| SQLite | UPNEXT_BACKEND=sqlite (optional UPNEXT_DATABASE_URL) | Tables are auto-created on startup |
| PostgreSQL | UPNEXT_BACKEND=postgres, UPNEXT_DATABASE_URL | Fails fast if required tables are missing; run migrations first |
Choosing by scale
- Use
redisfor the simplest deployment and low-scale persistence with no SQL dependency. - Use
sqlitefor local/dev setups that still need persistent history in a file. - Use
postgresfor larger or long-term deployments where query scale and retention are more demanding.
Redis vs PostgreSQL
| If you need… | Choose |
|---|---|
| Simplest setup with no SQL service dependency | UPNEXT_BACKEND=redis |
| Small, low-scale persistence with minimal infrastructure | UPNEXT_BACKEND=redis |
| Long retention windows and growing historical query load | UPNEXT_BACKEND=postgres |
| Production-scale durability and analytics-heavy dashboards | UPNEXT_BACKEND=postgres |
redis is a great beta/default path and postgres is the natural upgrade path as usage grows.
Redis has two roles
Redis can be used in two separate ways:- As the persistence backend when
UPNEXT_BACKEND=redis. - As the runtime stream/queue dependency through
UPNEXT_REDIS_URLfor workers and real-time server features.
sqlite or postgres) while still using UPNEXT_REDIS_URL for stream processing and real-time updates.