TDX LeaderboardsConfiguration
storage
SQLite vs MySQL — when to use which, full schema, pool sizing.
TDX Leaderboards ships with two storage backends. Pick the one that matches your topology, not the one that sounds fancier.
Which one should I use?
- SQLite — single-server installs. Zero configuration, runs in WAL
mode for concurrent reads, lives in
plugins/TDXLeaderboards/data.db. This is the right answer for ~95% of servers. - MySQL / MariaDB — networks. Multiple Paper backends (Survival, Skyblock, Prison…) sharing one database. Per-server isolation is automatic so backends don't stomp on each other's data.
If you're not sure, start with SQLite. Migrating later is supported.
Quick example
general:
storage: sqlite
# no further configuration requiredThe data file is plugins/TDXLeaderboards/data.db. Back it up with the
rest of your plugins/ directory.
general:
storage: mysql
mysql:
host: db.internal
port: 3306
database: tdxleaderboards
username: tdx
password: change-me
pool-size: 10
use-ssl: false
# Per-server identity. Defaults to your server.properties name; override
# if you run two backends with the same display name.
server-id: survivalReference (mysql block)
| Key | Type | Default | Notes |
|---|---|---|---|
host | string | localhost | Hostname or IP. Use the internal address if your DB is on the same VPC. |
port | int | 3306 | |
database | string | tdxlb | Must already exist; the plugin creates its own tables but not the schema. |
username | string | Needs ALL PRIVILEGES on the database (for the schema migrations). | |
password | string | Plaintext. Restrict file permissions on config.yml accordingly. | |
pool-size | int | 10 | HikariCP connection pool. 5–10 is right for most servers; raise only if pool starves. |
use-ssl | boolean | false | Enable for cross-host MySQL where the network is not trusted. |
server-id | string | auto | Per-server isolation key. Defaults to your server.properties server name. |
Migration: SQLite → MySQL
- Stop the server.
- Take a copy of
plugins/TDXLeaderboards/data.db. - Edit
general.storagetomysqland fill in themysql:block. - Start the server. The plugin builds an empty MySQL schema.
- Stop the server again.
- Run the bundled
tdxlb-migratetool (see the migration guide) pointing it at both yourdata.dband the new MySQL database. - Verify counts on a couple of boards in-game, then keep the SQLite copy as a rollback for at least a week.
Don't try to write to both backends simultaneously. The general.storage
switch is exclusive — runtime swaps are not supported and will corrupt
whichever side you wrote to last.