Request opinions on alternate erlang config formats

Roberto Aloi prof3ta@REDACTED
Thu Apr 2 07:52:58 CEST 2020


Hi,

Both approaches (key-value or sys.config) have pros and cons. Two aspects I
would take into account when making this choice are:

1. How complex is the config? Do I need to represent complex data
structures in my config? If so, a simple key-value or YML solution may
create more problems than it solves (quoting, doubts when translating
things into atoms or strings or binaries, long nested structures)

2. How is the configuration going to be managed? How does it vary among
hosts/clusters? Are there overriding rules? Tools like Ansible can handle
key-value environment files or similar smoothly, but the moment they have
to replace a hostname and a port within a multi-line proplist, the
playbooks/scripts immediately grow in complexity.

Roberto

On Thu, 2 Apr 2020 at 07:32, Amelia Aronsohn <squirrel@REDACTED> wrote:

>  What problem do they have with sys.config? Do you have problems you are
> trying to work around or is it "I want something I already know?"
>
> Best wishes,
> Amelia
>
> On 4/1/20, 14:01, "erlang-questions on behalf of Mark Geib" <
> erlang-questions-bounces@REDACTED on behalf of mark.geib.44@REDACTED>
> wrote:
>
>     I have been tasked with looking into alternatives to the
>     sys.config configuration for erlang releases that are more
>     palpable for non-erlangers. In my group there are non-erlang
>     developers that suggest property based key=value configs, and
>     others that suggest yaml.
>
>     I have looked into cuttlefish, but have reservations regarding
>     how it replaces the relx management script for a release, I
>     use rebar3. Also, there will certainly be times where structured
>     config is necessary and cuttlefish’s limitations will make that
>     difficult.
>
>     I have also looked at yaml parsers, basically transforming the
>     yaml config into erlang terms mimicking the sys.conf, and then
>     in my application start, I set the environment for the application
>     from this. This sort of works in the simple cases, but when you
>     need to configure multiple applications, like logger, then it
>     gets hard to do something general purpose. And I have not even
>     looked into how to handle dependencies that could have yaml
>     configs, etc.
>
>     So, does anyone use anything other than sys.conf, i.e. the native
>     erlang configuration, and if so what do you suggest.??
>
>     Also, is this really a problem.?? I have no problem with sys.conf,
>     but I write erlang and don’t get squeamish looking at nested braces.
>
>     Thanks, and I welcome all opinions.
>
>     Mark.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200402/14a8761b/attachment.htm>


More information about the erlang-questions mailing list