Skip to main content

Choose a database

The database holds everything that is not an uploaded file: settings, concerts, members, announcements, ticket orders, donor records and, unless you choose otherwise, login sessions. This page helps whoever installs the server pick one. It is a decision to make before the site has real data in it.

Which one​

You are runningUseWhy
One Node server or one Docker containerSQLiteNothing else to install or look after. The database is a file in the data folder. This is the default.
A platform with no lasting disk, more than one copy of the site, or a database service you already pay forPostgreSQL, or MySQL or MariaDBThe database is a separate service that several processes can share.
Cloudflare WorkersD1It is the only choice there.

A choir's site is small. SQLite on one server is enough for any choir, and it is what most self-hosted sites should use. Choose PostgreSQL or MySQL because your hosting calls for it, not for speed.

The setting​

DB_PROVIDER chooses the database on Node and Docker.

DB_PROVIDERDatabaseAlso needsPage
sqlite (the default)A SQLite filenothing; SQLITE_PATH to move the fileSQLite
postgres or postgresqlPostgreSQLDATABASE_URLPostgreSQL
mysql or mariadbMySQL or MariaDBDATABASE_URLMySQL and MariaDB

Write the value exactly, in lower case. Anything else stops the server at start:

Unknown DB_PROVIDER "…". Use sqlite, postgres or mysql (d1 is for Cloudflare).

Prefer postgres and mysql to their other spellings. postgresql and mariadb open the same databases, but the configuration check only notices a missing DATABASE_URL for the two short names.

Whichever you choose, the tables are created for you. How the database schema is kept up to date explains when.

Before you choose​

There is no tool to move data from one database to another. Nothing in the product copies a site from SQLite to PostgreSQL, from PostgreSQL to MySQL, or to or from D1. The three kinds of database store dates, numbers and identifiers differently enough that a plain dump of one will not load into another without work. Treat the choice as permanent for the life of the site.

No minimum versions are stated. The product does not name the oldest PostgreSQL, MySQL or MariaDB it supports, and does not check the version it connects to. What is known:

  • The Docker Compose file in the source uses postgres:16-alpine, and mariadb:11 in its commented-out alternative.
  • The MySQL schema file is headed "MySQL 8 / MariaDB 10.5+".
  • SQLite is built into Node, so its version is whichever your Node has. Node 22.13 or newer is required.

Use a version that is current and still supported by its maker.

SQLite is the best-tested of the three. The product's own automated tests run on SQLite, and none of them connects to a PostgreSQL or MySQL server. Those two are written to the same rules and share every query with SQLite, but if you choose one, try the whole site on it with sample data before you trust it with your choir's records: add a concert, add a member and log in as them, send an announcement, upload a file. And set up your own backups from the first day: the built-in update only makes a safety copy of a SQLite database.

What changes with the database​

SQLitePostgreSQL, MySQL, MariaDBD1
Tables createdAt every startAt every startBy hand, with Wrangler
More than one copy of the siteNoYesCloudflare's concern
Copy made before a one-click updateYes, the last three are keptNoDoes not apply
BackupsCopy the file, with careYour database's own toolsCloudflare's tools

Backups for each are in What to back up.