Once your Minecraft server passes 50 regular players, flat-file storage becomes a bottleneck. Plugin data saved to YAML or JSON files forces sequential disk I/O that blocks the main thread.
SQL databases solve this by handling data operations asynchronously and efficiently.
When Do You Need SQL?
You probably don't need a database if:
- Your server has fewer than 30 regular players
- You run basic plugins (EssentialsX, WorldGuard)
- Data doesn't need to be shared between servers
You definitely need a database if:
- BungeeCord/Velocity network with shared data
- Economy plugins serving 50+ players
- Rank/permissions synced across servers
- Custom plugins with heavy data operations
- Auction house or marketplace with frequent transactions
MySQL vs SQLite
| Feature | SQLite | MySQL | |---------|--------|-------| | Setup | Zero | Requires installation | | Performance (small) | Excellent | Overkill | | Performance (large) | Degrades | Scales well | | Concurrent access | Limited | Designed for it | | Cross-server sync | No | Yes | | Backup | Copy one file | Mysqldump |
For single servers under 50 players, SQLite is fine. For networks or large servers, MySQL is the right choice.
Plugins That Benefit from MySQL
| Plugin | Without SQL | With SQL | |--------|------------|----------| | LuckPerms | File per player | Shared across network, instant sync | | EssentialsX | Flat files | Faster player data loading | | CMI | Built-in flat file | Reduced I/O, shared warps/homes | | Vault/Economy | File-based | Transaction logging, cross-server balance | | LiteBans | Local SQLite | Network-wide bans, faster lookups | | CoreProtect | SQLite (slow at scale) | 50x faster lookup on large databases |
CoreProtect is the most dramatic improvement. A 10GB CoreProtect SQLite database takes 30+ seconds to query. The same data in MySQL returns results in under a second.
Setting Up MySQL
On a Space-Node plan, MySQL databases are included. Create one through the control panel and get your connection details.
For plugins, the database configuration typically looks like:
storage:
type: mysql
host: localhost
port: 3306
database: minecraft_data
username: server_user
password: your_secure_password
pool-size: 10
The pool-size setting determines how many simultaneous database connections your plugins can use. 10 is good for most servers. Large networks might need 20-30.
Performance Tips
Use connection pooling: Most modern plugins use HikariCP for connection pooling. Don't increase pool size beyond what you need; idle connections waste memory.
Index your tables: If running custom plugins, make sure frequently queried columns have indexes. Player UUID lookups are the most common query and should always be indexed.
Separate databases per plugin: Don't dump everything into one database. Give each major plugin its own database for easier management and backup.
Regular maintenance: Run OPTIMIZE TABLE monthly on large tables. CoreProtect tables grow fast and benefit from periodic optimization.
A properly configured MySQL database turns your Minecraft server from a hobbyist project into infrastructure that can handle thousands of players across multiple servers without breaking a sweat.
