-
Notifications
You must be signed in to change notification settings - Fork 0
Storage Backends
ServerDoctor persists performance history, conflicts, security risks, recommendations and
plugin inventory through a single StorageProvider abstraction with five interchangeable
repositories. Five backends ship in the box.
All backends are selected via storage.type in Configuration. The storage
module is framework-free: the platform adapter reads the config and hands the storage layer a
plain StorageConfig, so no Bukkit/Velocity types leak into persistence.
type: memory- No credentials, nothing written to disk; everything is lost on restart.
- Intended for testing or ephemeral setups, and used as the last-resort fallback.
-
type: sqlite,sqlite.file: "serverdoctor.db" - Embedded, zero-setup, single file in the data folder.
- Access is serialized through one connection (a single-writer model).
- Best for a single node with local disk.
type: postgresql- Pooled via HikariCP; the schema is created automatically (
CREATE TABLE IF NOT EXISTS). - Driver:
org.postgresql:postgresql. - Tables:
performance,conflicts,security_risks,recommendations,plugin_inventory. - Recommended for networks — multiple ServerDoctor instances can share one database.
type: mariadb- Same pooled JDBC backend as PostgreSQL, only the SQL dialect differs (auto-increment key,
DOUBLE,ON DUPLICATE KEY). - Driver:
org.mariadb.jdbc:mariadb-java-client(also works against MySQL servers). - Indexed timestamp columns are
VARCHAR(64)to satisfy MariaDB's index rules.
type: mongodb- Driver:
org.mongodb:mongodb-driver-sync. - Collections:
performance,conflicts,security_risks,recommendations,plugin_inventory. Each plugin-inventory snapshot is one document with an embeddedpluginsarray. "Most recent first" ordering uses the documents'_id. - Accepts either discrete
host/port/username/password/auth-databasefields or a fullconnection-string(e.g. an Atlasmongodb+srv://…URI), which takes precedence.
PostgreSQL and MariaDB use HikariCP (max pool size 10, min idle 2, 30s connection timeout, 30min max lifetime). Pooling also handles reconnects, so a server-side idle timeout won't break persistence.
All four drivers are bundled into the universal jar. The MongoDB driver plus BSON is the
largest. If you only use SQL backends, you can drop the mongodb-driver-sync dependency in
serverdoctor-storage/build.gradle.kts to keep the jar smaller — only type: mongodb is
then unavailable.
On a multi-node network, point the proxy and every backend server at the same PostgreSQL/MariaDB/MongoDB. They all write into one store, giving you a network-wide history. SQLite and In-Memory are per-node only.
ServerDoctor · read-only analysis for Minecraft servers & proxies · MIT · Repository