Storage
Choose between SQLite, H2, MySQL and MariaDB, where each keeps its data, and what changing it means.
Emberstore keeps orders, subscriptions, referral codes and waiting rewards in a database. SQLite works out of the box. Use MySQL or MariaDB when several servers share one store, or when you already run a database server.
storage:
# sqlite, h2, mysql or mariadb. Changing it starts a fresh database, data is not copied over
type: sqlite
h2:
# Database file name without extension, kept in the data folder
file: "emberstore-h2"
mysql:
host: localhost
port: 3306
database: emberstore
username: root
password: ""
pool-size: 5
mariadb:
host: localhost
port: 3306
database: emberstore
username: root
password: ""
pool-size: 5| Type | Where the data is | Use it for |
|---|---|---|
sqlite | plugins/Emberstore/data/emberstore.db | One server. The default. |
h2 | plugins/Emberstore/data/<file>.mv.db | One server, if you prefer H2. |
mysql | Your MySQL server, set in storage.mysql | Networks, or an existing MySQL server. |
mariadb | Your MariaDB server, set in storage.mariadb | Networks, or an existing MariaDB server. |
Only the block for the chosen type is read. pool-size is the most connections Emberstore keeps open.
Rules that keep your data safe
- Changing
storage.typestarts a fresh, empty database. Nothing is copied between types. Pick one before you take real payments. - No silent fallback. An unknown type, a missing driver, a wrong password or an unreachable host stops Emberstore at startup with a clear message. It never switches to another database on its own, which would start an empty store.
- Updates add to the database. New versions add their tables and columns on startup without touching your data.
- Money is stored exactly, as whole cents (or paise, and so on), never as rounded decimals.
- Database libraries for H2, MariaDB and the connection pool are downloaded by Paper on the first start. SQLite and MySQL drivers come with Paper.
Backups
For SQLite or H2, stop the server and copy the data folder. For MySQL or MariaDB, use your database's own backup tool. The database is the record of every payment, so back it up as often as your world.