Database
A database stores all region data — claims, members, bans, logs, and settings. Homestead includes a built-in caching system that improves performance for region lookups.
Supported Providers
| Provider | Recommended For |
|---|---|
| SQLite (default) | Small servers (~100 players), no setup required |
| MySQL | Large servers (~1,000+ players) |
| MariaDB | Large servers (~1,000+ players) |
| PostgreSQL | Large servers (~1,000+ players) |
| MongoDB | Medium servers (~500 players) |
| YAML | Small/private servers (~50 players), human-readable files |
Configuration
Set the provider in config.yml:
SQLite
The default — no setup needed. Database file is saved to the server directory.
MySQL / MariaDB / PostgreSQL
database:
provider: "mysql" # or "mariadb", "postgresql"
mysql:
host: "localhost"
port: 3306
username: "USERNAME"
password: "PASSWORD"
database: "homestead_data"
table_prefix: "" # e.g. "myserver_"
jdbc_url_parameters: "" # e.g. "?useSSL=false&serverTimezone=UTC"
MongoDB
database:
provider: "mongodb"
mongodb:
uri: "mongodb://localhost:27017" # Or Atlas SRV URI
database: "homestead"
collection_prefix: "hs_"
YAML
Not Recommended for Production
YAML is human-readable but slow. Only use for testing or tiny private servers.
Cache System
Homestead caches all data in memory for fast lookups. Modified data is periodically written back to the database.
Recommendations:
| Players | Interval |
|---|---|
| <20 | 30s |
| 20-50 | 60s |
| 50-100 | 120-180s |
| 100+ | 300s |
Changing Providers
To switch databases without losing data:
- Configure the new provider in
config.yml(but keepproviderset to the old one) - Run
/hsadmin reload - Run
/hsadmin export [new-provider] - Wait for the export to complete
- Stop the server
- Update
providerto the new value inconfig.yml - Start the server
Read more: Database Migration