2 ms·
I’m surprised to see nobody brought up the 12 Factor App principle about config, https://12factor.net/config https://12factor.net/config Anything that's chang
by mlthoughts2018 7y ago
I’m surprised to see nobody brought up the 12 Factor App principle about config,
https://12factor.net/config https://12factor.net/config
Anything that's changing from one run of your application to another is config. Static settings that don’t change from one run to another are not config, they are just static pieces of data and it does not matter how you store them other than that you ensure it meets the operating need of your application.
Configs, however, which can change from one run to the next, are different. They need to be factored out of code completely and only addressed by inspection of the runtime environment.
Whatever tool you use to ensure they are injected to the environment is also a totally uninteresting decision as long as it meets the operating needs of your deployment system.
That’s it.
1. store static constants and data items however you want as long as your program meets its operating requirements
2. config is not the same as static constants or static data, config can change from one run of the application to another.
3. factor config completely out of the code so it is solely referenced as part of the environment
4. store external configs however you want so long as the operating constraints of the deployment system are met.
Within items 1 and 4, debate over relative merits of different tools is almost always useless bikeshedding unless it boils down to a real operating constraint of either the app itself or the deployment system.
For example, a system that puts secret access tokens (config, not static settings) into the environment by storing them in plaintext environment variables might violate a security operating constraint of the deploy system and so a different system that manages encrypted secrets injected into the environment safely could be the winner for real operating reasons.
Meanwhile, whether to store “staging” vs “production” database connections in Python / YAML / JSON / TOML / etc. because of comments / whitespace / use of builtin library “extra” code / whatever is just pure bikeshedding waste of time.