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.
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 creates a number of tables, all of which are prefixed with the value of
imply-state- in this example.
The types of databases supported as Pivot state stores are MySQL (
mysql), Postgres (
pg), and SQLite (