-
Notifications
You must be signed in to change notification settings - Fork 0
Storage and Data
RoyalBazaar persists each item's price state (its mid, yesterday's mid for 24h change, volume, and price-history snapshots) so the market survives restarts. Prices are authoritative in memory and written to storage on a background interval (write-behind), so trading never blocks on disk.
One implementation serves both backends via HikariCP; you pick which in config.yml.
storage:
type: SQLITE
sqlite-file: bazaar.dbZero setup — a bazaar.db file is created in plugins/RoyalBazaar/. Ideal for a single server. The database uses WAL mode, so you may also see bazaar.db-wal and bazaar.db-shm files next to it; that's normal.
storage:
type: MYSQL
mysql:
host: localhost
port: 3306
database: royalbazaar
username: root
password: ""
properties: "useSSL=false"
pool-size: 10Use MySQL to share one market across a network of servers. Create the database once (CREATE DATABASE royalbazaar;) and grant your user access; RoyalBazaar creates its tables on first connect.
The JDBC driver and HikariCP are downloaded at runtime by Paper's library loader — they aren't bundled into the jar.
Changing
typerequires a full server restart, not/bazaar reload. RoyalBazaar does not migrate data between SQLite and MySQL for you — switching backends starts fresh (prices simply re-seed from each item'sbase_price).
- Trades update the in-memory mid immediately.
- Changed prices are flushed to storage every
engine.flush-interval-seconds(default 30s). - A price-history snapshot is written every
engine.history-interval-seconds(default 300s) for the 24-hour change and trend arrow. - Everything is flushed cleanly on shutdown.
A hard crash can lose at most the last flush interval of price drift — never a completed trade's item or money movement, which go through Vault and the player's inventory at trade time.
For SQLite, back up bazaar.db while the server is stopped (or copy all three bazaar.db* files together while running). For MySQL, use your normal database backup tooling.
RoyalBazaar · part of the eco suite (RoyalBank · RoyalAuctions · EconGuard) · Source on GitHub
Getting started
Using it
Help