Q2Application Deployment and Security
Applications may sometimes keep configuration as code constants, violating the strict separation of configuration from code. Where should application configuration be stored?
← → navigate · a answer
Community votes
Discussion · 16
25
should be A
10
Answer is A
https://12factor.net/config
A 3
Selected Answer: A
Correct answer: A
Configuration stored in environment / Store config in the environment
Source: https://12factor.net/config
2
If you read this document, answer B (YAML file) is correct:
"Another approach to config is to use config files which are not checked into revision control, such as config/database.yml "
2
"This is a huge improvement over using constants which are checked into the code repo, but still has weaknesses: it’s easy to mistakenly check in a config file to the repo"
2
Will go with B here. Since they are talking about configuration.
From DEVCORE Training:
"Before you start using files to store your network parameters, you need to determine the format of your configuration files. The most popular formats for storing data are YAML, JSON, XML, and CSV."
2
I'm not sure if they are referring to when the app is in production, and in this case the env_variables could be the answer or where we store the config information for deployment in several environments, and in this case YAML would be my answer.
But the reference to the 12factor, for me, is the clue to the answer so I'll go with A
2
A is the correct answer
A 2
Selected Answer: A
A is correct
## Factor III: Config ##
- Store config in the environment.
Config is everything likely to vary between deploys: credentials, resource handles, and per-deploy values. The 12-factor app requires strict separation of config from code and stores config in environment variables (or env vars).
Environment variables are easy to change between deploys without changing any code and, unlike config files, there is a low chance of them being checked into the code repo accidentally.
1
Yes, but using environment variables is only possible on dev workstations, not on production servers.
1
OK sorry, my mistake.
A: Environment variables is the right answer.
1
In practice you use both, env. vars and files (ini/yaml/what-have-you). But strict separation of configuration from code makes this a 12factor app question. So A it is.
1
For me it is B
1
Should be A. It's clearly stated that it's environment variables.
1
should be A
A 1
Selected Answer: A
should be A