All applications have a configuration that varies from one environment to another. The configuration is found at multiple locations; application code, property files, databases, environment variables, Java Naming and Directory Interface (JNDI), and system variables are a few examples.
A Twelve-Factor App should store configuration in the environment. While environment variables are recommended in order to manage configuration in a Twelve-Factor App, other alternatives, such as having a centralized repository for application configuration, should be considered for more complex systems.
Irrespective of the mechanism that's used, we recommend that you do the following:
- Manage configuration outside the application code (independent of the application's deployable unit)
- Use a standardized way of configuration