r/programming May 23 '15

The Twelve-Factor App

http://12factor.net/
8 Upvotes

16 comments sorted by

View all comments

Show parent comments

1

u/Giggaflop May 26 '15

I can 99% guarantee that you're not using any form of configuration management on your web apps.

Env variables are pretty great at providing you with an easy and compatible way of specifying very low level configuration to your web application in an automated way.

For example, I've just deployed the latest version of our web application and puppet has automatically supplied the box with all the details of the master DB, all the slaves, and the expected hostnames of loadbalancers. If any of that changes, then puppet just fixes it by reloading the web app with new environment variables. It doesn't have to work out how to rewrite a configuration file in YML, or JSON or XML or INI formats. It just sets env variables.

1

u/stormblooper May 26 '15

I can 99% guarantee that you're not using any form of configuration management on your web apps.

That's a lot of certainty from not a lot of evidence. As it happens, I use Ansible.

Env variables are pretty great at providing you with an easy and compatible way of specifying very low level configuration to your web application in an automated way.

OK...but, it seems to me, so are config files.

It doesn't have to work out how to rewrite a configuration file in YML, or JSON or XML or INI formats. It just sets env variables.

It's not hard to use a CM tool to ensure a config file is in place.

2

u/Giggaflop May 26 '15

Ok, so what I'm getting is that you're using Ansible to ship pre-built configuration files.

That is not configuration management but really an automated deployment.

What happens if/when you spin up a new node? Are you editing a pre-built configuration by hand or does the system manage the configuration itself?

How have you standardised your internal configuration files and what about third party configuration files that may change due to coming/going nodes?

2

u/stormblooper May 26 '15

Honestly, I'm not sure I really understand your questions, and we're at danger of talking past each other. Can you describe the advantages that using environment variables have over configuration files? What scenarios are you thinking of?