CS FundamentalsModerateProduct-company DevOps interview

According to the Twelve-Factor App methodology, where should a service keep its database URL and API keys that differ between staging and production?

  1. A. In a config file committed to the repository, one per environment
  2. B. Hard-coded constants selected by a build flag
  3. C. Inside the Docker image
  4. D. In environment variables (or a secrets store exposed through them), strictly separated from code

Correct answer: D. In environment variables (or a secrets store exposed through them), strictly separated from code

Factor III says config that varies between deploys belongs in the environment, not the code; a test is whether the code could be open-sourced right now without leaking credentials.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic