The Game Panel Design record
The Game Panel
ADR-0016 Accepted

Support only PostgreSQL 16 is the only supported databaseand above

Comparing
v1 to v2
Current
Read the document

Context

The panel assumes MySQL, or a compatible MariaDB, and supports other drivers inside the database component without exposing them, per as ADR-0007 records. MySQL was chosen as the simplest the simplest assumption for people setting the panel up.

The panel is built from scratch and distributed ships as a binary it controls, per as ADR-0009 records, so what the database it runs against against is the panel's s choice rather than whatever a host happens to provide. Nothing needs requires it to run on more than one one database.

Subsystems that Several subsystems are designed but not built need things built, and each needs something a database either provides or does not: delivery of events : delivering events between processes, a queue claiming jobs without in which two workers taking never claim the same onejob, a scheduler electing one instance that elects one instance to run a due task, and policies that restrict which rows a request can see.

Decision

I will make PostgreSQL is the panel's only supported database, at version 16 or above. , and drop MySQL and MariaDB are no longer supportedMariaDB, and so that the engine engine commits to one dialect rather than abstracting over two. The floor is 16 because it is the lowest default across every currently supported mainstream distribution, so nobody self-hosting has to add a third-party package repository, and because it is supported upstream until November 2028.

The floor is 16 because it is the lowest default across every currently supported mainstream distribution, so nobody self-hosting has to add a third-party package repository, and it is supported upstream until November 2028.

Alternatives

Staying on MySQL or MariaDB, as before. The reason recorded for moving is that I rejected this because PostgreSQL offers more of what what the panel needs, and that and nothing still forces the simpler assumption MySQL was chosen for, now that the panel is built built from scratch and ships as as its own binary. The comparison itself is not recorded.

Supporting both, by abstracting over the two dialects. There is no requirement I rejected this because nothing requires the panel to run run anywhere but where the panel it is installed, so the abstraction would cost more than it gives, and neither dialect would be used used properly.

Consequences

Easier:

  • Subsystems that are The subsystems already designed will be built on what the database provides: notifications for delivering to deliver events, , skip-locked reads for claiming to claim queued jobs, advisory locks for electing to elect a scheduler, and session variables variables carrying the the identity that row-level policies read.
  • Schema changes will run inside transactions, so a migration that fails part way rolls will roll back entirely, which makes will make the migration runner simpler.
  • Nobody self-hosting will have to add a package repository to install a supported version.

Harder:

  • Everything built on MySQL's dialect will have to be replaced, not merely extended: its types, its upsert and replace and replace statements, and its full-text search.
  • The database layer's tests will have to be re-earned rather than preserved, since the layer is will be rewritten.

Constrained:

  • Features newer than the floor cannot will not be relied available to rely on. JSON_TABLE arrives in 17, and native uuidv7() and virtual virtual generated columns in 18. None is needed: identifiers are generated in PHP, per as ADR-0011 records, so one exists before its row is inserted.
  • The panel will run against one database, and a deployment an installation wanting another is will not be supported.

Sources

  • Issue #51, Engine - Database - PostgreSQL, , whose revisions only reformatted its list of cards: the decision, the version floor and the distributions it follows, upstream support until November 2028, what the floor costs and why none of it is needed, committing to one dialect rather than abstracting over two, what changes in types, queries and connections, and each primitive with the consumer that needs it. This is created and decided; the decision came from a session before that date, which is not recalled.
  • Issue #54, Engine - Database - PostgreSQL test infrastructure and CI, : the floor run locally and the newer versions covered in continuous integration, and the layer's coverage and mutation score being re-earned.
  • Issue #59, Engine - Database - Schema: tables, indexes and DDL objects, : schema changes running inside transactions, and the two statements that cannot.
  • PostgreSQL having considerably more features and functionality that the panel benefits from, and MySQL having been the simpler assumption for a panel built from scratch and distributed as its own binary: first written down on .

Source adr/0016-postgresql-16.md · commit 9444a99 · published