tapscrollWIKI

Cross-server

One shared market across a whole network — MySQL for storage, Redis pub/sub for instant invalidation.

Gavel v1.0.0Paper · Folia supported1.21 – 1.21.x

Gavel's cross-server mode is a genuinely shared market: a listing created on survival-1 appears on skyblock-2 immediately, and a sale is settled once, not twice.

Two pieces make that work — a shared database and a live invalidation channel.

Storage

plugins/Gavel/config.yml
storage:  type: SQLITE  sqlite:    file: "gavel.db"

SQLite is zero setup and correct for a single server. It comfortably handles a few hundred thousand rows.

MySQL (or MariaDB) is required for a network:

YAML
storage:  type: MYSQL  mysql:    host: "127.0.0.1"    port: 3306    database: "gavel"    username: "root"    password: ""    table-prefix: "gavel_"    properties:      useSSL: false      allowPublicKeyRetrieval: true      characterEncoding: "utf8"    pool:      maximum-pool-size: 8      minimum-idle: 2      connection-timeout-ms: 8000      idle-timeout-ms: 300000      max-lifetime-ms: 1200000

table-prefix decides who shares a market

Servers with the same prefix share one market. Servers with different prefixes have separate markets in the same database. Both are valid setups — a survival and a skyblock economy usually should not be joined — but mixing them up by accident is the mistake that is hard to undo.

The connection pool defaults suit a network of a few servers. Raise maximum-pool-size only if you actually see connection-timeout warnings; a larger pool against a small database server makes things worse, not better.

Live sync

YAML
sync:  enabled: true  redis:    host: "127.0.0.1"    port: 6379    username: ""    password: ""    database: 0    ssl: false    channel: "gavel:sync"

Without Redis, a second server only sees new listings after its own cache expires — up to performance.listing-cache-seconds (30) later. With it, every write publishes an invalidation and all servers refresh at once.

More importantly, it prevents the window where two servers both believe a listing is available. Gavel's purchase flow is race-safe regardless (money first, then a compare-and-set on the row, with a refund if the CAS loses), so nobody ever loses money — but without sync, players see "that listing is gone" messages they should never have seen.

Setting it up

  1. Create the database

    BASH
    mysql -u root -p -e "CREATE DATABASE gavel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
  2. Configure every server identically

    Same host, database, username and same table-prefix on every server that should share the market.

    The one value that differs per server:

    YAML
    general:  server-name: "survival-1"
  3. Point them at one Redis channel

    YAML
    sync:  enabled: true  redis:    host: "10.0.0.5"    channel: "gavel:sync"

    Every server on the shared market must use the same channel. If you run two separate markets in one Redis instance, give each its own channel name.

  4. Restart and verify

    BASH
    /aha info

    It reports the storage backend, whether sync is connected, the economy provider and the listing counts. Run it on two different servers and confirm the counts match.

Economy has to be shared too

Gavel shares the market. It does not share your economy — that is Vault's job.

If survival-1 and skyblock-2 have separate balances, a shared auction house lets players transfer wealth between them by selling an item to themselves. Either share the economy database, or give the two servers separate table-prefix values so they have separate markets.

This is the one that bites people

Shared market + separate economies = a currency exploit, not a feature. Decide which of the two you are running before players start listing.

Migrating from SQLite

There is no automatic import. If you started on SQLite and now need MySQL, the low-risk path is:

  1. Announce a listing freeze and let existing listings expire (or /aha remove them, which mails the items back to their owners).
  2. Confirm mailboxes are empty.
  3. Switch storage.type to MYSQL and restart.

Nobody loses an item, because everything removed goes to the mailbox first.

Folia

Gavel declares folia-supported: true and runs on Folia. The scheduling model is region-based rather than a single main thread; nothing about the configuration changes.