Let's suppose we have a elixir service that spawns some workers to do a job, the supervisor takes configuration from config and starts the workers. Now the classic way to configure such a project in prod is to use releases.exs, where you can configure environment variables and the release will reload the configuration.
What I want to implement now is a dashboard that will control multiple services configuration, this means that there should be a centralized storage for configuration and some kind of signaling when to change configuration.
Let's suppose we use postgres, some tables to store the configuration and custom signaling/ postgres NOTIFY to notify that the configuration has changed and needs to be reloaded.
The questions that arise are:
- Is it possible/recommended to change the releases.exs file responsible for configuration in a release so that the new configuration is persisted across reloads?
- Is it possible to implement this for dev environment? since as far as I know dev environment does not support runtime configuration currently.
- Is it intended behavior that releases.exs replaces configuration added with Application.put_env/4 with option persistent: true?