Database Guide
Overview
PlumDelivery supports three database backends to store player data. Choose the one that best fits your server's needs.
Comparison
| Feature | RozsDBLite | SQLite | MySQL |
|---|---|---|---|
| Type | File-based NoSQL | File-based SQL | Remote SQL |
| Setup Required | ❌ None | ❌ None | ✅ MySQL Server |
| Performance | Good | Good | Best |
| Scalability | Small-Medium | Medium | Large / Network |
| Connection Pooling | N/A | HikariCP (1 conn) | HikariCP (10 conn) |
| Cross-Server | ❌ No | ❌ No | ✅ Yes |
| Data Format | Binary files | SQL database file | Remote SQL tables |
Setup Guides
RozsDBLite (Default)
No configuration needed! Just set the driver:
database:
driver: RozsDBLite
Data is stored as binary files in the plugin's data folder.
SQLite
database:
driver: SQLite
A database.db file will be created in the plugin's data folder. Uses HikariCP for connection management.
MySQL
- Create a database on your MySQL server:
CREATE DATABASE PlumDelivery;
- Configure the connection in
config.yml:
database:
driver: MySQL
hostname: localhost
port: 3306
username: root
password: your_secure_password
database: PlumDelivery
The plugin will automatically create the required tables on first startup.
Connection Pool Settings
MySQL HikariCP Configuration
The MySQL implementation uses these HikariCP settings:
| Setting | Value |
|---|---|
| Maximum Pool Size | 10 |
| Minimum Idle Connections | 2 |
| Connection Timeout | 30,000 ms |
| Idle Timeout | 600,000 ms |
| Max Lifetime | 1,800,000 ms |
| Prepared Statement Cache | Enabled (250 / 2048) |
SQLite HikariCP Configuration
| Setting | Value |
|---|---|
| Maximum Pool Size | 1 |
| Minimum Idle Connections | 1 |
Data Schema
Both SQL backends use this table structure:
CREATE TABLE IF NOT EXISTS plum_users (
uuid VARCHAR(36) PRIMARY KEY,
points TEXT,
current_goals TEXT
);
points: JSON string mapping"type:category"→ point countcurrent_goals: JSON string mapping"type:category"→ highest achieved goal
Auto-Save
Regardless of the database backend, data is automatically saved:
- Every 10 minutes (12,000 server ticks)
- On server shutdown (graceful stop)
Warning
If the server crashes without a graceful shutdown, up to 10 minutes of data may be lost. This is rare but worth noting.
Migrating Between Databases
Caution
There is currently no built-in migration tool. Switching database drivers will start with a fresh database. Always back up your data before changing drivers!
To migrate manually:
- Stop the server
- Back up your current data files/database
- Change the
driverinconfig.yml - Start the server (new empty database)
- Manually transfer data if needed
