Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>12 Factor has 3 "requirements" for configuration.</p> <ol> <li>Don't store configuration in code</li> <li>Don't put your configuration in source control (or in a format that's likely to end up in source control). They want a "single codebase".</li> <li>Put your configuration in a format that's accessible to any technology stack (.NET/Java/Ruby/.. etc).</li> </ol> <p>I'd say that .NET config files comply with half of these. </p> <ol> <li>Config files aren't in code (pass). </li> <li>Config files don't have to be in source control, but they often end up there (fail). </li> <li>Despite being in XML format and accessible to other technologies, .NET config files have a lot of .NETisms. Schema for configsections are provided by .NET types, so a Java app couldn't verify the schema. (half-credit).</li> </ol> <p>While I can agree with the intent of their requirements, I think that their suggestion of Environment Variables is a bad suggestion. They chose Environment Variables because they view them as a lowest common denominator and available on all platforms, but they really might not be available on all platforms. If you're running in a partial-trust web app (common on a shared hosting platform), you might not have access to get/set environment variables. </p> <p>Environment variables are set per machine. If I have to make a configuration change to my production environment I want to make it once, in one place, for all servers. Environment variables don't let you do that. </p> <p>While I can see their point that you don't want secrets stored in version control that are accessible to all developers. There are definitely benefits to version controlling your configuration. When your production environment goes down because of a configuration change, it's easy to ask .. "what changed"? The audit trail left by someone just ssh'ing to a prod machine and setting an environment variable might not be so easy to trace. Having said that, I often don't store my configuration files in the same part of version control as the rest of the code. I put them in a folder that has restricted security so that only the necessary people need access. You could conceivably take that a step further and put them in a different project.</p> <p>I'd be willing to bet that they violate their own rules of not putting configuration in files. For example. The first bullet point on their home page is "Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;" I'm betting that all those config settings that aren't supposed to be in a file anywhere are in a chef recipe. To achieve the goal of automation, you have to persist them in some file somewhere. And I'd be surprised if someone that spent a lot of time getting a chef recipe right didn't store it in version control somewhere.</p> <p>I think they could have written the configuration page differently and just said keep your configuration separate from your code. Keep it in separate files (don't embed it in code), and store it somewhere separately (don't put it in the same repository). Your deployment process will bring these back together (code and config) into one deployable package, but they should be separate until that point.</p> <p>My suggestion for configuration would be to treat the configuration as an "attached resource" and store it in a backing store (a database). This makes your app tier even more stateless which is another one of their goals.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload