PlumDeliveryPlumDelivery
Home
Guide
  • Overview
  • Database
  • Deliveries
  • Menus
  • Categories
  • Rewards
  • Messages
Commands
Placeholders
  • Overview
  • Methods
  • Events
Database Guide
FAQ
GitHub
Home
Guide
  • Overview
  • Database
  • Deliveries
  • Menus
  • Categories
  • Rewards
  • Messages
Commands
Placeholders
  • Overview
  • Methods
  • Events
Database Guide
FAQ
GitHub
  • Database

    • Database Guide

Database Guide

Overview

PlumDelivery supports three database backends to store player data. Choose the one that best fits your server's needs.

Comparison

FeatureRozsDBLiteSQLiteMySQL
TypeFile-based NoSQLFile-based SQLRemote SQL
Setup Required❌ None❌ None✅ MySQL Server
PerformanceGoodGoodBest
ScalabilitySmall-MediumMediumLarge / Network
Connection PoolingN/AHikariCP (1 conn)HikariCP (10 conn)
Cross-Server❌ No❌ No✅ Yes
Data FormatBinary filesSQL database fileRemote 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

  1. Create a database on your MySQL server:
CREATE DATABASE PlumDelivery;
  1. 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:

SettingValue
Maximum Pool Size10
Minimum Idle Connections2
Connection Timeout30,000 ms
Idle Timeout600,000 ms
Max Lifetime1,800,000 ms
Prepared Statement CacheEnabled (250 / 2048)

SQLite HikariCP Configuration

SettingValue
Maximum Pool Size1
Minimum Idle Connections1

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 count
  • current_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:

  1. Stop the server
  2. Back up your current data files/database
  3. Change the driver in config.yml
  4. Start the server (new empty database)
  5. Manually transfer data if needed