Storage Configuration
HyperPerms supports multiple storage backends for persisting permission data. This guide covers available options and their configuration.
Available Storage Types
| Type | Status | Best For |
|---|---|---|
| json | Available | Single servers, small to medium scale |
| mariadb | Available | Multi-server networks, MariaDB/MySQL compatible |
| postgresql | Planned | Enterprise deployments |
| sqlite | Available | Analytics, audit logs, single server performance |
JSON Storage (Default)
JSON storage is the default backend. It stores all data in human-readable JSON files in the mod directory.
Configuration
json
{
"storage": {
"type": "json"
}
}File Locations
text
mods/com.hyperperms_HyperPerms/
βββ config.json # Main configuration
βββ groups.json # Group definitions
βββ users.json # User data
βββ tracks.json # Track definitions
βββ backups/ # Automatic backups
βββ backup-2026-01-15-120000.json
βββ backup-2026-01-14-120000.jsonFile Structure: groups.json
json
{
"default": {
"displayName": "Default",
"weight": 0,
"prefix": "&7",
"suffix": null,
"prefixPriority": 0,
"suffixPriority": 0,
"permissions": [
{
"permission": "chat.use",
"value": true,
"expiry": null,
"contexts": {}
}
],
"parents": []
},
"vip": {
"displayName": "VIP",
"weight": 20,
"prefix": "&a[VIP] ",
"suffix": null,
"prefixPriority": 0,
"suffixPriority": 0,
"permissions": [
{
"permission": "chat.color",
"value": true,
"expiry": null,
"contexts": {}
}
],
"parents": ["default"]
}
}File Structure: users.json
json
{
"853c80ef-3c37-49fd-aa49-938b674adae6": {
"uuid": "853c80ef-3c37-49fd-aa49-938b674adae6",
"username": "Steve",
"primaryGroup": "vip",
"groups": ["vip"],
"permissions": [],
"customPrefix": null,
"customSuffix": null
}
}File Structure: tracks.json
json
{
"staff": {
"name": "staff",
"groups": ["helper", "mod", "admin", "owner"]
},
"donor": {
"name": "donor",
"groups": ["vip", "vip-plus", "mvp"]
}
}Advantages
- No external dependencies
- Human-readable and editable
- Easy to backup and restore
- Simple to set up
Limitations
- Not ideal for very large datasets
- No native multi-server sync
- File I/O can be slower than database
JSON storage is sufficient for most servers. Consider database storage only if you have thousands of users or need multi-server synchronization.
Manual Backups
text
# Create a manual backup
/hp backup create my-backup
# List available backups
/hp backup list
# Restore from backup
/hp backup restore my-backupBackup Strategy Recommendations
| Server Size | Interval | Max Backups |
|---|---|---|
| Small (<50 players) | 3600 (1 hour) | 24 |
| Medium (50-200 players) | 1800 (30 min) | 48 |
| Large (200+ players) | 900 (15 min) | 96 |
SQLite Storage
SQLite provides better performance than JSON for single servers and enables analytics tracking and audit logs. The SQLite JDBC driver is not bundled with HyperPerms to keep the JAR small (2.4MB vs 15MB).
Driver Installation
- Download the SQLite JDBC driver from sqlite-jdbc releases
- Place the downloaded JAR in
mods/com.hyperperms_HyperPerms/lib/ - Restart the server
Configuration
json
{
"storage": {
"type": "sqlite"
}
}SQLite storage enables analytics tracking and audit logs. Once the driver is installed, you can enable analytics in the main configuration.
MariaDB/MySQL Storage
MariaDB/MySQL storage provides full database support with HikariCP connection pooling, ideal for multi-server networks. Compatible with both MariaDB and MySQL.
Configuration
json
{
"storage": {
"type": "mariadb",
"mariadb": {
"host": "localhost",
"port": 3306,
"database": "hyperperms",
"user": "hyperperms",
"password": "secure-password",
"useSSL": false
}
}
}Features
- Full CRUD for users, groups, and tracks
- HikariCP connection pooling for optimal performance
- Backup and restore via JSON dump strategy
- Native multi-server synchronization
Make sure your MariaDB/MySQL user has the necessary permissions to create tables and perform read/write operations on the specified database.
Migrating Storage
You can migrate between storage backends using the migrate command:
text
/hp migrate mariadb
/hp migrate sqlite
/hp migrate jsonManual File Editing
You can manually edit JSON files, but be careful:
- Stop the server or unload the mod first
- Create a backup before editing
- Validate JSON syntax (use a JSON validator)
- Start the server and verify with
/hp reload
Invalid JSON will prevent HyperPerms from loading. Always validate your changes before starting the server.
Troubleshooting
Data Not Saving
- Check file permissions on the mod directory
- Ensure disk space is available
- Look for errors in console logs
- Try
/hp reloadto force a reload
Corrupted JSON Files
- Restore from the latest backup
- Check for JSON syntax errors
- Use a JSON validator to find issues
Backup Restore Fails
- Verify the backup file exists and is readable
- Check that backup isn't corrupted
- Ensure you have the correct permissions
See Also
- Main Configuration
- General Commands (backup commands)
- Troubleshooting Guide