universe docs source
browse docs
docs /extensions /databases

Database extensions

Database extensions register a DatabaseProvider under a provider key, replacing the built-in H2 and MySQL backends. PostgreSQL, MongoDB, and Redis each ship as a separate JAR and are selected through ./database.json.

Universe ships with two built-in database providers, H2 and MySQL. Three more are available as extensions: PostgreSQL, MongoDB, and Redis. Each registers a DatabaseProvider under its provider key during onLoad(). To switch backends, drop the matching JAR into ./extensions/ and set the provider key in ./database.json.

!
warning

Switching database backends does not migrate existing data. Universe starts with an empty database under the new provider, so export or re-create anything you need before changing the provider key.

Provider configuration

extension-db-postgres is a production-grade relational backend suited to multi-node clusters with concurrent writes. It uses jOOQ with the PostgreSQL dialect for SQL.

{
	"provider": "postgres",
	"host": "127.0.0.1",
	"port": 5432,
	"database": "universe",
	"username": "universe",
	"password": "changeme"
}
FieldDescription
providerMust be "postgres".
hostServer hostname or IP.
portDefault 5432.
databaseDatabase name.
usernameDatabase user.
passwordDatabase password.

Choosing a backend

  • PostgreSQL for clusters that need durable, concurrent relational writes. The default choice for production.
  • MongoDB when you prefer document storage and want to avoid managing a schema.
  • Redis for fast, ephemeral lookups where persistence guarantees matter less.