TDXPlugins
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

plugins/TDXLeaderboards/config.yml
general:
  storage: sqlite
# no further configuration required

The data file is plugins/TDXLeaderboards/data.db. Back it up with the rest of your plugins/ directory.

plugins/TDXLeaderboards/config.yml
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: survival

Reference (mysql block)

KeyTypeDefaultNotes
hoststringlocalhostHostname or IP. Use the internal address if your DB is on the same VPC.
portint3306
databasestringtdxlbMust already exist; the plugin creates its own tables but not the schema.
usernamestringNeeds ALL PRIVILEGES on the database (for the schema migrations).
passwordstringPlaintext. Restrict file permissions on config.yml accordingly.
pool-sizeint10HikariCP connection pool. 5–10 is right for most servers; raise only if pool starves.
use-sslbooleanfalseEnable for cross-host MySQL where the network is not trusted.
server-idstringautoPer-server isolation key. Defaults to your server.properties server name.

Migration: SQLite → MySQL

  1. Stop the server.
  2. Take a copy of plugins/TDXLeaderboards/data.db.
  3. Edit general.storage to mysql and fill in the mysql: block.
  4. Start the server. The plugin builds an empty MySQL schema.
  5. Stop the server again.
  6. Run the bundled tdxlb-migrate tool (see the migration guide) pointing it at both your data.db and the new MySQL database.
  7. 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.