AT-AuctionHouse logoAT-AuctionHouse

Storage

Choosing between SQLite, MySQL and MongoDB, what tables get created and what you need to back up.

Listings, payouts and transaction history all live in one database. Which one is up to you.

DATABASE:
  TYPE: SQLITE
ValueUse it forSetup
SQLITEA single serverNone. One file
MYSQLA network, or a database you already runA database and a user
MONGODBA network, document storageA connection string

Changing TYPE needs a full server restart. /ah reload deliberately does not re-read it, because swapping backends at runtime would strand every in-flight query. Changing it also does not migrate your existing data. The old data stays where it is and the new backend starts empty.

An unknown TYPE falls back to SQLITE with a warning.

SQLite

DATABASE:
  TYPE: SQLITE
  SQLITE:
    FILE: "plugins/AT-AuctionHouse/auction.db"

The default, and the right answer for a single server. One file, no server to run, no credentials to manage.

FILE is relative to the server root. The parent folder is created for you.

SQLite cannot be shared between servers. If you want one auction house across a network, you need MySQL or MongoDB. See Cross-server.

MySQL

DATABASE:
  TYPE: MYSQL
  MYSQL:
    HOST: "localhost"
    PORT: 3306
    DATABASE: "auction"
    USER: "root"
    PASSWORD: "password"
    USE-SSL: false
    ALLOW-PUBLIC-KEY-RETRIEVAL: true
KeyWhat it doesDefault
HOSTMySQL hostnamelocalhost
PORTMySQL port3306
DATABASEDatabase name. It has to exist alreadyauction
USERMySQL usernameroot
PASSWORDMySQL passwordpassword
USE-SSLEncrypt the connectionfalse
ALLOW-PUBLIC-KEY-RETRIEVALAllow the driver to fetch the server's public keytrue

The database has to exist. The plugin creates its own tables inside it but will not create the database itself.

The TLS keys

These two go together, and getting them wrong is the most common MySQL problem.

USE-SSL: false
ALLOW-PUBLIC-KEY-RETRIEVAL: true

This is the shipped default and it is what makes a plain setup work out of the box.

ALLOW-PUBLIC-KEY-RETRIEVAL only matters with caching_sha2_password, which is the MySQL 8 default authentication plugin, on an unencrypted connection. Without it, the driver cannot get the key it needs to authenticate and the connection is refused.

Leave it like this when the database is on the same machine or inside a network you control.

MongoDB

DATABASE:
  TYPE: MONGODB
  MONGODB:
    URI: "mongodb://localhost:27017"
    DATABASE: "auction"
    COLLECTION: "auction_listings"
KeyWhat it doesDefault
URIStandard connection stringmongodb://localhost:27017
DATABASEDatabase nameauction
COLLECTIONBase collection nameauction_listings

Credentials, replica sets and mongodb+srv:// URIs all work in URI, including TLS options. There are no separate TLS keys for MongoDB because the connection string already carries them.

COLLECTION is a base name. Three more collections are derived from it, see below.

What gets created

Three tables, created automatically on the first start, on both SQLite and MySQL.

TableHolds
ah_listingsEvery listing, active or otherwise, with its serialized item, price, timestamps, status and originating server
ah_transactionsCompleted sales: buyer, seller, item, price and timestamp
ah_payoutsThe collection box. Money or an item owed to a player, with a claimed flag and a reason

Indexes are created alongside them. On MySQL a re-run of the index statements legitimately fails with "duplicate key name" and is ignored. Anything else is logged as a warning, because a missing index is a silent performance problem.

Backups

Back up whatever holds ah_listings, ah_transactions and ah_payouts, or their MongoDB equivalents. That is the whole of the plugin's live state.

BackendWhat to back up
SQLiteThe file named by DATABASE.SQLITE.FILE, by default plugins/AT-AuctionHouse/auction.db
MySQLThe database named by DATABASE.MYSQL.DATABASE
MongoDBThe database named by DATABASE.MONGODB.DATABASE

ah_payouts matters as much as ah_listings. It holds every item and every payment owed to a player who was offline or had no room. Restoring listings without payouts loses real player property.

Also worth keeping, though they are not live state:

  • config.yml
  • gui.yml
  • lang/ if you edited it or added a translation

Copy the SQLite file while the server is stopped, or use SQLite's own online backup. A plain file copy of an active database can catch it mid-write.

Drivers

Every driver is declared in plugin.yml and downloaded by the server at startup into an isolated classloader. Nothing to install by hand.

Only the driver matching your DATABASE.TYPE is ever initialised, so choosing SQLite does not load MySQL or MongoDB code, and two plugins can use different driver versions without clashing.

The first startup after installing the plugin, or after changing DATABASE.TYPE, needs network access to download the driver. Once cached, later startups are offline-safe.

How the data is kept correct

Every state change that moves value is a single conditional update rather than a read followed by a write.

Selling a listing flips it from active to sold in one statement that only matches if it is still active, so exactly one buyer wins a race and everyone else is told the listing is gone. Claiming from the collection box works the same way, so an item can be collected once and only once.

This holds across servers as well as within one, which is what makes cross-server mode safe.

Checking what is in use

/ah about

reports the platform, the storage backend actually in use, whether cross-server mode is on, and how many active listings are cached. It needs atauctionhouse.admin.

On this page