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 running | Use | Why |
|---|---|---|
| One Node server or one Docker container | SQLite | Nothing 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 for | PostgreSQL, or MySQL or MariaDB | The database is a separate service that several processes can share. |
| Cloudflare Workers | D1 | It 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_PROVIDER | Database | Also needs | Page |
|---|---|---|---|
sqlite (the default) | A SQLite file | nothing; SQLITE_PATH to move the file | SQLite |
postgres or postgresql | PostgreSQL | DATABASE_URL | PostgreSQL |
mysql or mariadb | MySQL or MariaDB | DATABASE_URL | MySQL 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, andmariadb:11in 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
| SQLite | PostgreSQL, MySQL, MariaDB | D1 | |
|---|---|---|---|
| Tables created | At every start | At every start | By hand, with Wrangler |
| More than one copy of the site | No | Yes | Cloudflare's concern |
| Copy made before a one-click update | Yes, the last three are kept | No | Does not apply |
| Backups | Copy the file, with care | Your database's own tools | Cloudflare's tools |
Backups for each are in What to back up.