Skip to content

Storage

Brotkrumen stores plugin data using the storage backend configured in config.yml.

By default, Brotkrumen uses SQLite. This is the recommended option for most servers because it does not require any additional setup.

The storage configuration is located under the data section:

################
# Data Storage #
################
data:
# The desired storage-method for the plugin data.
storageMethod: 'sqlite'

Brotkrumen currently supports the following storage methods:

Storage methodDescription
sqliteLocal database file. No extra configuration required.
mysqlRemote MySQL database. Requires connection information.
mariadbRemote MariaDB database. Requires connection information.

SQLite is the default storage option and should work out of the box.

To use SQLite, keep the storage method set to sqlite:

data:
storageMethod: 'sqlite'

No database host, username, password, or connection pool settings are required for SQLite.

This is the easiest setup and is recommended for small to medium-sized servers or servers that do not need a shared external database.

To use MySQL or MariaDB, change storageMethod to either mysql or mariadb.

Example:

data:
storageMethod: 'mysql'
tablePrefix: 'brotkrumen'
host: 'localhost'
port: 3306
database: 'minecraft'
user: 'user'
password: 'pw'

For MariaDB, use:

data:
storageMethod: 'mariadb'

The tablePrefix option controls the prefix used for Brotkrumen database tables.

data:
tablePrefix: 'brotkrumen'

Brotkrumen will automatically create tables with this prefix if they do not already exist.

Changing table prefixes

Changing tablePrefix after data has already been created does not automatically rename existing tables.

If you change the prefix, Brotkrumen may create a new set of tables and existing data may appear to be missing until the configuration or database is migrated manually.

Remote storage methods require connection information:

data:
host: 'localhost'
port: 3306
database: 'minecraft'
user: 'user'
password: 'pw'
OptionDescription
hostAddress of the database server.
portPort of the database server. Usually 3306 for MySQL and MariaDB.
databaseName of the database where Brotkrumen stores its data.
userDatabase username.
passwordDatabase password.

The poolSettings section controls the database connection pool for MySQL and MariaDB.

data:
poolSettings:
maximumPoolSize: 10
minimumIdle: 10
maximumLifetime: 1800000
keepAliveTime: 0
connectionTimeout: 5000
OptionDescription
maximumPoolSizeMaximum number of database connections in the pool.
minimumIdleMinimum number of idle connections the pool tries to maintain.
maximumLifetimeMaximum lifetime of a connection in milliseconds.
keepAliveTimeInterval used to keep connections alive. Set to 0 to disable keepalive.
connectionTimeoutMaximum time in milliseconds Brotkrumen waits for a database connection.

The default values are suitable for most servers.

################
# Data Storage #
################
data:
# The desired storage-method for the plugin data.
#
# Possible options:
#
# | Flat-file / local database - no extra configuration needed
# | => SQLite
#
# | Remote databases - requires connection information.
# | => MySQL
# | => MariaDB
#
# A SQLite database is the default storage option.
storageMethod: 'sqlite'
# The following options are only relevant for remote database storage methods.
# The prefix for the tables in the database.
# The plugin will automatically create tables with this prefix if they do not exist yet.
# In migration scenarios, the plugin will not automatically rename the table prefix.
tablePrefix: 'brotkrumen'
# The default address and port for the database.
host: 'localhost'
port: 3306
# The name of the database to store Brotkrumen data in.
# The database has to be created manually before the first plugin startup.
database: 'minecraft'
# The credentials for the database.
user: 'user'
password: 'pw'
# These settings apply to the MySQL or MariaDB connection pool.
# The default values are suitable for the majority of users.
# DO NOT change these settings unless you know what you are doing.
poolSettings:
maximumPoolSize: 10
minimumIdle: 10
maximumLifetime: 1800000
keepAliveTime: 0
connectionTimeout: 5000

Use sqlite if you want a simple setup without external dependencies.

Use mysql or mariadb if you run a larger server network, want centralized storage, or need to access the same Brotkrumen data from an external database system.