SQL Databases and Minecraft: Why Your Large Server Needs a Proper Database

Published on

Flat-file storage breaks under load. Here's why MySQL and MariaDB are non-negotiable for any Minecraft hub over 30 players, and how to configure them.

Written by Alex van der Berg – Infrastructure Engineer at Space-Node – 15+ years combined experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Read author bio →

SQL Databases and Minecraft: Why Your Large Server Needs a Proper Database

Most Minecraft servers start with flat-file storage — YAML files for player data, JSON for economy balances, text files for ban lists. For a 5-player private SMP, this is fine. For a 50-player public server, it is a performance and reliability disaster waiting to happen.

The Flat-File Problem at Scale

When 50 players are online simultaneously, every save operation on a flat-file data store must:

  1. Load the entire file into memory
  2. Modify the relevant data
  3. Write the entire file back to disk

With a 500 KB player data file written 20 times per minute, you are generating significant I/O. With multiple plugins all doing this simultaneously, you have disk contention. The result: random lag spikes that look like TPS drops but have no CPU cause.

A SQL database writes only the changed rows, handles concurrent reads elegantly, and operates through a persistent connection rather than repeated file opens.

Setting Up MariaDB

MariaDB is MySQL's community fork — faster for most workloads and free. Install on your server or use Space-Node's database add-on.

# Install on Ubuntu/Debian
sudo apt install mariadb-server
sudo mysql_secure_installation

# Create a database for your server
mysql -u root -p
CREATE DATABASE minecraft_server;
CREATE USER 'mc_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON minecraft_server.* TO 'mc_user'@'localhost';
FLUSH PRIVILEGES;

Migrating Plugins to Database Storage

Most major plugins support both flat-file and SQL storage. Switching is a one-time migration:

LuckPerms:

storage-method: mysql
data:
  address: localhost
  port: 3306
  database: minecraft_server
  username: mc_user
  password: your_password
  pool-settings:
    maximum-pool-size: 10

EssentialsX (via separate database bridge plugin)
CoreProtect:

database-mysql: true
mysql-host: localhost
mysql-port: 3306
mysql-database: minecraft_server
mysql-username: mc_user
mysql-password: your_password

HikariCP Connection Pooling

The most common database performance mistake is reopening a connection for every query. Every major Minecraft plugin uses HikariCP — a connection pool that keeps a set of pre-established database connections ready to use instantly. Ensure maximum-pool-size is set to approximately the number of concurrent plugin threads (8–16 for most servers).

Performance Difference

On a busy server performing 500 database operations per minute:

| Storage | Avg operation time | Concurrent write handling | |---|---|---| | YAML flat-file | 12–45ms | Sequential (blocks) | | SQLite | 5–15ms | Limited concurrent | | MariaDB (HikariCP) | 0.5–3ms | Full concurrent |

The 10–90x improvement in operation speed under load is why no large server should be running flat-file storage.

Space-Node offers managed database add-ons for all hosting plans

About the Author

Alex van der Berg – Infrastructure Engineer at Space-Node – Experts in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 15+ years combined experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

Our team specializes in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters. We maintain GDPR compliance and ISO 27001-aligned security standards.

View Space-Node's full team bio and credentials →

Start Minecraft Server in Minutes

Join content creators worldwide who trust our minecraft infrastructure. Setup is instant and support is always available.

SQL Databases and Minecraft: Why Your Large Server Needs a Proper Database