Databases, Redis and media storage
Choose SQLite, PostgreSQL or MySQL, add Redis for several instances, and move media to S3.
Databases
| Dialect | Use when | DSN example |
|---|---|---|
sqlite (default) | One instance, small to medium traffic, simple backups. | data/hydro.db |
postgres | More traffic or several instances. | postgres://hydro_app:[email protected]:5432/hydro?sslmode=verify-full |
mysql (and MariaDB) | You already run MySQL, or your host provides it. | hydro:secret@tcp(db.internal:3306)/hydro |
HYDRO_DATABASE_DIALECT=postgres
HYDRO_DATABASE_DSN=postgres://hydro_app:[email protected]:5432/hydro?sslmode=verify-full
hydro migrate --config config.yamlEvery migration ships SQL for all three dialects, so you can move between SQLite, PostgreSQL and MySQL by running hydro migrate on the target database and streaming your data with hydro portable export --format ndjson --scope all and hydro portable import --format ndjson --confirm.
SQLite notes
- Keep the database on local disk, not a network share.
- Only HydroGo should write to the file; set
database.sqlite_external_write_watch: trueif other tools might. - Back it up with
hydro backup sqlite, not by copying a live file.
Redis or Valkey
Optional for one instance, recommended for several. With redis.url set, rate limits and caches are shared, so counters are correct no matter which instance answers.
HYDRO_REDIS_URL=rediss://:[email protected]:6379/0
HYDRO_REDIS_KEY_PREFIX=hydro:Media on S3
By default media lives in media.dir on local disk. For multiple instances, containers without volumes, or large libraries, use an S3-compatible bucket (AWS S3, MinIO, Cloudflare R2, and similar) and, optionally, a CDN.
HYDRO_MEDIA_STORAGE_DRIVER=s3
HYDRO_MEDIA_S3_ENDPOINT=s3.eu-central-1.amazonaws.com
HYDRO_MEDIA_S3_BUCKET=example-media
HYDRO_MEDIA_S3_REGION=eu-central-1
HYDRO_MEDIA_S3_ACCESS_KEY=REPLACE_ME
HYDRO_MEDIA_S3_SECRET_KEY=REPLACE_ME
HYDRO_MEDIA_CDN_BASE_URL=https://cdn.example.com
# self-hosted stores often need path-style addressing
HYDRO_MEDIA_S3_FORCE_PATH_STYLE=trueSizing guidance
| Setup | Profile | Database | Extras |
|---|---|---|---|
| Personal site, one editor | compact | SQLite | none |
| Company site or blog | standard | SQLite or PostgreSQL | CDN for media |
| High traffic or redundancy | distributed | PostgreSQL or MySQL | Redis, S3, several instances |