Storage Backends
InviteMe supports four storage backends. Choose the right one for your server size and setup.
Quick Comparison
Section titled “Quick Comparison”| Backend | Best For | Setup | Performance | Multi-Server |
|---|---|---|---|---|
| JSON | Testing only | None | Low | No |
| SQLite | Small/medium servers | None | Good | No |
| MySQL | Production servers | Medium | Excellent | Yes |
| PostgreSQL | Large networks | Medium | Excellent | Yes |
JSON reads and writes the entire file on every operation. On servers with real players this causes data corruption and severe lag. Use SQLite at minimum.
JSON (Not Recommended for Production)
Section titled “JSON (Not Recommended for Production)”Stores data as plain text files in plugins/InviteMe/.
storage: type: jsonFiles created:
plugins/InviteMe/invites.jsonplugins/InviteMe/action_log.jsonplugins/InviteMe/player_stats.json
Use only for:
- Local testing and development
- Reviewing raw data manually
- Debugging strange behavior
Never use JSON for:
- Servers with actual players
- Production environments
- Any server with > 10 players
SQLite (Default — Recommended for Most Servers)
Section titled “SQLite (Default — Recommended for Most Servers)”SQLite is the default backend and works out of the box — no extra configuration needed.
Stores data in a single local database file. No external software needed.
storage: type: sqliteFile created: plugins/InviteMe/invites.db
Pros:
- Zero configuration — works out of the box
- Single file — easy to back up (
cp invites.db invites.db.backup) - Reliable — used by thousands of servers
Cons:
- Cannot be shared between servers (single file)
- Not suitable for > 500 concurrent players
Recommended for:
- Single servers up to ~500 players
- Survival servers, SMP, creative servers
- Servers without a separate database host
MySQL (Recommended for Production)
Section titled “MySQL (Recommended for Production)”Connects to an external MySQL or MariaDB server.
storage: type: mysql remote: host: localhost # or db.myserver.com port: 3306 database: inviteme username: inviteme_user password: "SecurePass123" pool-size: 10Setting Up MySQL
Section titled “Setting Up MySQL”Step 1: Create the database
Connect to your MySQL server and run:
CREATE DATABASE inviteme CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'inviteme_user'@'%' IDENTIFIED BY 'SecurePass123';GRANT ALL PRIVILEGES ON inviteme.* TO 'inviteme_user'@'%';FLUSH PRIVILEGES;Step 2: Update config.yml
storage: type: mysql remote: host: your-database-host.com port: 3306 database: inviteme username: inviteme_user password: "SecurePass123" pool-size: 10Step 3: Reload InviteMe
/im reloadStep 4: Verify connection
/im debugTuning pool-size for MySQL
Section titled “Tuning pool-size for MySQL”| Server size | Recommended pool-size |
|---|---|
| < 20 players | 5 |
| 20–100 players | 10 (default) |
| 100–500 players | 20 |
| 500+ players | 30–50 |
MariaDB Compatibility
Section titled “MariaDB Compatibility”InviteMe uses the MariaDB JDBC driver, which is fully compatible with:
- MariaDB 10.x and 11.x
- MySQL 5.7+
- MySQL 8.x
PostgreSQL
Section titled “PostgreSQL”Alternative to MySQL with similar performance characteristics.
storage: type: postgresql remote: host: localhost port: 5432 # default PostgreSQL port database: inviteme username: inviteme_user password: "SecurePass123" pool-size: 10Setting Up PostgreSQL
Section titled “Setting Up PostgreSQL”Step 1: Create the database
Connect via psql and run:
CREATE DATABASE inviteme;CREATE USER inviteme_user WITH ENCRYPTED PASSWORD 'SecurePass123';GRANT ALL PRIVILEGES ON DATABASE inviteme TO inviteme_user;Step 2: Update config.yml (note the port 5432)
storage: type: postgresql remote: host: your-database-host.com port: 5432 database: inviteme username: inviteme_user password: "SecurePass123"Step 3: /im reload and verify with /im debug
MySQL vs PostgreSQL — When to Choose
Section titled “MySQL vs PostgreSQL — When to Choose”Both work equally well for InviteMe. Choose based on:
- What you already have running — don’t add a new database server just for InviteMe
- Hosting panel — most Minecraft hosts provide MySQL, not PostgreSQL
- Personal preference — both are excellent choices
Migrating Between Backends
Section titled “Migrating Between Backends”InviteMe can migrate all your data automatically with zero downtime.
How to Migrate
Section titled “How to Migrate”Example: SQLite → MySQL
- Set up your MySQL database (see above)
- Update
config.ymlwith MySQL credentials - Run the migration command:
/im migrate mysql
- InviteMe migrates all data and renames the old file:
invites.db→invites.db.migrated
Other migrations:
/im migrate sqlite # Any backend → SQLite/im migrate mysql # Any backend → MySQL/im migrate postgresql # Any backend → PostgreSQLSafety Guarantees
Section titled “Safety Guarantees”- Original data is never deleted — only renamed to
.migrated - If migration fails, nothing changes — your data is safe
- Migration creates a log entry for auditing
Checking Migration Success
Section titled “Checking Migration Success”/im debug# Verify: Total records matches your previous countBackups
Section titled “Backups”SQLite Backup (Simple)
Section titled “SQLite Backup (Simple)”cp plugins/InviteMe/invites.db backups/invites_$(date +%Y%m%d).dbMySQL/PostgreSQL Backup
Section titled “MySQL/PostgreSQL Backup”Use your database’s native backup tools:
mysqldump -u inviteme_user -p inviteme > inviteme_backup.sql
pg_dump -U inviteme_user inviteme > inviteme_backup.sqlTroubleshooting
Section titled “Troubleshooting”“Connection failed” on MySQL/PostgreSQL
- ✅ Verify the host is reachable from your server
- ✅ Check port is open in firewall (3306 for MySQL, 5432 for PostgreSQL)
- ✅ Confirm username/password are correct
- ✅ Verify the database exists
- ✅ Check user has GRANT privileges on the database
“Storage shows JSON but I set SQLite”
- ✅ Run
/im reloadafter editing config.yml - ✅ Check for YAML indentation errors in config.yml
“Migration didn’t transfer all records”
- ✅ Run
/im syncafter migration to verify whitelist - ✅ Check
plugins/InviteMe/invites.db.migrated— data is preserved there - ✅ The
.migratedfile can be re-migrated if needed
Next Steps
Section titled “Next Steps”- ⚙️ Full config options: Config Reference
- 🔗 LuckPerms: LuckPerms Integration
- ❓ FAQ: Frequently Asked Questions
Need help?
Get support and chat with the community