Database & Communication

Setting up database backends and proxy-backend communication.

Database Backends

mineLogin supports four database backends. Choose one based on your deployment needs.

A document-based database. This is the recommended storage backend for production deployments.

database:
  data-type: MONGODB
  mongo-db-connection-string: "mongodb://localhost:27017"
  base: "mineLogin"
OptionTypeDefaultDescription
mongo-db-connection-stringString"mongodb://localhost:27017"Full MongoDB connection URI
baseString"mineLogin"Database name

Best for: production environments, large communities, scalable deployments.

H2 (Default)

An embedded database that requires no external setup. Data is stored locally on the proxy server.

database:
  data-type: H2

Best for: testing and small communities.

MySQL

A relational database for production deployments.

database:
  data-type: MYSQL
  hostname: "localhost"
  base: "mineLogin"
  port: 3306
  username: "root"
  password: "securepass"
  ssl-use: false
  max-life-time: 1800000
  max-pool-size: 20
  connection-timeout: 3000
OptionTypeDefaultDescription
hostnameString"localhost"MySQL server address
baseString"mineLogin"Database name (must exist)
portInteger3306MySQL server port
usernameString"root"Database user
passwordString"securepass"Database password
ssl-useBooleanfalseEnable SSL for the database connection
max-life-timeInteger1800000HikariCP max connection lifetime in milliseconds
max-pool-sizeInteger20HikariCP maximum pool size
connection-timeoutLong3000Connection timeout in milliseconds
show-mysql-errorsBooleantrueShow database errors in the console

Tip: mineLogin uses HikariCP for connection pooling, ensuring efficient database performance.

Flat (Deprecated)

YAML file-based storage. Not recommended for production use.

database:
  data-type: FLAT

Tip: The FLAT storage type is deprecated and will be removed in a future version. Consider migrating to MongoDB, MySQL, or H2.


Proxy-Backend Communication

mineLogin supports three communication backends for synchronizing data between the proxy and backend servers.

Plugin Messaging Channel (Default)

Uses Bukkit/BungeeCord plugin messaging for proxy-to-backend communication. No additional setup required.

communication:
  type: PLUGIN_MESSAGING_CHANNEL

Best for: simple setups where no external message broker is available.

Uses Redis pub/sub for proxy-to-backend communication. Recommended for production deployments.

communication:
  type: REDIS
  host: "localhost"
  port: 6379
  password: "securepass"
OptionTypeDefaultDescription
hostString"localhost"Redis server address
portInteger6379Redis server port
passwordString"password"Redis password

Best for: production environments, large networks.

Redis Cloud

  1. Visit Redis Cloud and create a free account
  2. Create a new database using the free tier (30MB)
  3. Select a cloud provider and region close to your server
  4. Note down the connection details: endpoint, port, and password
communication:
  type: REDIS
  host: "your-redis-cloud-endpoint.com"
  port: 12345
  username: "default"
  password: "your-redis-cloud-password"

Self-Hosted Redis with Docker

Create a docker-compose.yml file:

version: '3'
services:
  redis:
    image: redis:latest
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    command: redis-server --appendonly yes --requirepass your_strong_password

volumes:
  redis_data:

Start Redis:

docker-compose up -d
communication:
  type: REDIS
  host: "localhost"
  port: 6379
  username: null
  password: "your_strong_password"

Tip: If your proxy runs inside Docker (e.g. Pterodactyl), use the Docker host IP (172.18.0.1) instead of localhost.

Redis Security

  • Always use a strong password for Redis
  • Restrict network access using firewall rules — do not expose Redis to the internet
  • Keep Redis updated with the latest security patches

An alternative message broker for proxy-to-backend communication. Also recommended for production.

communication:
  type: NATS
  host: "localhost"
  port: 4222
  username: "username"
  password: "password"
OptionTypeDefaultDescription
hostString"localhost"NATS server address
portInteger4222NATS server port
usernameString"username"NATS username
passwordString"password"NATS password

Best for: high-throughput environments, microservice architectures.


Data Migration

mineLogin includes built-in tools for migrating data between storage backends. All migration commands must be executed from the proxy console.

Tip: Always create a full backup of your current database before starting the migration. Schedule migrations during low-traffic periods.

Step 1: Export Data

Run the export command in the proxy console:

minelogin internalMigration export

Monitor the console for confirmation that all user data has been exported.

Step 2: Update Configuration

Stop the proxy server and change the data-type and connection details in your configuration to the new database backend. Save the file.

Step 3: Restart and Import

Start the proxy server, then run:

minelogin internalMigration import

Wait for the console to confirm that the import has completed. Prevent new players from joining until the migration is finished.

Step 4: Verify

Check that player data is intact by using /ml userinfo <username> on a few accounts. Once verified, you can remove the old database and temporary files.