Storage and Database
Configure SQLite, MySQL, MariaDB, or PostgreSQL, and understand what is stored.
ProVouchers persists anti-dupe stamps and code-use counters in a database through
Strata's pooled storage. The backend is chosen
in config.yml. The default needs no setup.
Choosing a backend
storage:
# backend: sqlite | mysql | mariadb | postgres
backend: sqlite
# The settings below are used only by the networked backends.
host: localhost
port: 5432
database: provouchers
username: provouchers
password: ""
pool-size: 10| Backend | When to use | Setup |
|---|---|---|
sqlite | Single server, zero setup (default) | None. Creates plugins/ProVouchers/data.db. |
mysql | A network sharing one database | A MySQL server and database |
mariadb | Same as MySQL, MariaDB driver | A MariaDB server and database |
postgres | Same, PostgreSQL | A PostgreSQL server and database |
The JDBC driver and connection pool are provided by Strata; you do not install or shade anything yourself.
SQLite (default)
Nothing to configure. A data.db file is created in the plugin folder on first
start. Best for a single server.
MySQL / MariaDB / PostgreSQL
Create a database and a user, then point config.yml at it:
storage:
backend: postgres
host: 10.0.0.5
port: 5432
database: provouchers
username: provouchers
password: "a-strong-password"
pool-size: 10pool-size is the maximum number of pooled connections. The default of 10 is
fine for most servers; raise it only if you run a large network with heavy
redemption traffic. The default ports are 3306 for MySQL/MariaDB and 5432 for
PostgreSQL.
Use a networked backend (MySQL, MariaDB, or PostgreSQL) when several servers should share anti-dupe and code-use data, so a voucher item or a one-time code cannot be redeemed again on a different server in the network.
What is stored
ProVouchers keeps a small, indexed schema (tables are prefixed provouchers_):
| Table | Holds |
|---|---|
provouchers_redeemed_stamps | One row per redeemed voucher item, keyed by its batch and nonce. Powers anti-dupe. |
provouchers_code_uses | Per-player redemption counts for codes. Powers uses-per-player and max-uses. |
provouchers_cooldowns | Per-player, per-voucher cooldown expiry. Survives restarts; loaded on join. |
provouchers_offline_gives | Reserved for the planned offline-give queue. |
Lookups are by primary key and writes happen off the main thread, so storage never blocks gameplay. The schema is created and migrated automatically on first start.