Pivot state sharing
This section describes considerations for storing the Pivot state, particularly if you want to distribute Pivot among multiple servers. In this case, you'll need to configure the Pivot state store as an external database.
See also the full detail view of the config API.
State storage
You need to tell Pivot where to save its state.
Pivot can save state in either a local SQLite file or a database (for clustering).
Saving state in a file
The simplest place to save Pivot's state is in a SQLite file located somewhere relative to the config. To do so, add the following to the config:
stateStore:
type: sqlite
connection: ./pivot-settings.sqlite
Saving state in a database
For clustering to work, Pivot's state needs to be saved in an external database. To do so, add the following to the config:
stateStore:
type: mysql
connection: 'mysql://username:password@hostname:3306/database'
tablePrefix: 'imply-state-'
This will create a number of tables, all of which will be prefixed with the supplied tablePrefix
.
Note: currently only MySQL (mysql
), Postgres (pg
), and SQLite (sqlite
) are supported as state stores.