Skip to content

Storage and Data

joogiebear edited this page Jul 14, 2026 · 1 revision

Storage & Data

Database

RoyalAuctions stores listings, the collection, and bids in SQLite by default, or MySQL for a network / shared setup.

storage:
  type: SQLITE            # or MYSQL
  sqlite-file: auctions.db
  mysql:
    host: localhost
    port: 3306
    database: royalauctions
    username: root
    password: ""
    properties: "useSSL=false&characterEncoding=utf8&allowPublicKeyRetrieval=true"
    pool-size: 10

Connections are pooled with HikariCP over JDBC. Tables: ra_listings, ra_collection, ra_bids.

SQLite vs MySQL

  • SQLite — zero setup, single file (auctions.db in the plugin folder). Right for a single server.
  • MySQL — point several servers at one database so listings are shared network-wide. Fill in the mysql block and set type: MYSQL.

How items are stored

Items are serialized with Paper's serializeAsBytes(), which preserves the full NBT / component data. That's why:

  • eco custom items survive a listing intact, with no per-plugin code, and
  • a listed item even survives the eco plugin being uninstalled — the bytes are self-contained.

The ra_bids table

The listing row only ever stored the current top bidder — so once a player was outbid, there was no record they'd ever bid, which made "auctions I've bid on" unknowable. Every bid is now recorded in ra_bids, which powers View Bids (/ah bids).

Not backfillable. Only bids placed from the version that introduced ra_bids onward appear in View Bids — there's no historical data to reconstruct for older bids.

Category & tier stamping

A listing's category and tier are computed when it's created and stored on the row; browsing never recomputes them. Consequences:

  • Renaming a category id would strand old listings — so RoyalAuctions re-derives and persists those on load (see Categories).
  • Listings created before tiers existed have no tier and show only under No Filter (see Item Tiers).

Expiry

Every expiry-sweep-minutes (default 5), the plugin sweeps for expired listings and returns each expired item to its seller's Collection. Nothing is deleted — an unsold item comes back to be reclaimed with /ah collect.

Backups

RoyalAuctions doesn't ship a backup command. For SQLite, copy auctions.db while the server is stopped (or use a scheduler/OS job). For MySQL, back up with your normal database tooling. Don't copy the live .db file while the server is running.

Resetting

To wipe all auction data, stop the server and delete auctions.db (SQLite) or drop the ra_* tables (MySQL). A fresh schema is created on next start.

Clone this wiki locally