Emberstore logoEmberstore

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.

Four storage types: sqlite, the default, in data/emberstore.db; h2 in data/emberstore-h2.mv.db; mysql and mariadb on your database server, which networks need. Changing storage.type starts a fresh empty database.
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
TypeWhere the data isUse it for
sqliteplugins/Emberstore/data/emberstore.dbOne server. The default.
h2plugins/Emberstore/data/<file>.mv.dbOne server, if you prefer H2.
mysqlYour MySQL server, set in storage.mysqlNetworks, or an existing MySQL server.
mariadbYour MariaDB server, set in storage.mariadbNetworks, 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.type starts 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.

On this page