nerdexam
Cisco

350-901 · Question #53

Application sometimes store configuration as constants in the code, which is a violation of strict separation of configuration from code. Where should application configuration be stored?

The correct answer is A. environment variables. The 12-Factor App methodology mandates storing configuration in environment variables to achieve strict separation of config from code and enable portability across environments.

Application Deployment and Security

Question

Application sometimes store configuration as constants in the code, which is a violation of strict separation of configuration from code. Where should application configuration be stored?

Options

  • Aenvironment variables
  • BYAML files
  • CPython libraries
  • DDockerfiles
  • EINI files

How the community answered

(23 responses)
  • A
    87% (20)
  • D
    9% (2)
  • E
    4% (1)

Why each option

The 12-Factor App methodology mandates storing configuration in environment variables to achieve strict separation of config from code and enable portability across environments.

Aenvironment variablesCorrect

Environment variables are the standard 12-Factor App method for externalizing configuration because they are language- and OS-agnostic, cannot be accidentally committed to source control, and can be changed per deployment environment without modifying code.

BYAML files

YAML files can still be bundled with the application codebase, making them susceptible to accidental commit and not achieving strict separation from code.

CPython libraries

Python libraries are code artifacts and embedding configuration in them directly violates the separation-of-config-from-code principle.

DDockerfiles

Dockerfiles are part of the build artifact and are committed to source control, making them an inappropriate place for environment-specific configuration.

EINI files

INI files suffer the same problem as YAML files - they are typically stored alongside the codebase and do not enforce strict separation.

Concept tested: 12-Factor App config stored in environment variables

Source: https://12factor.net/config

Topics

#Application configuration#Environment variables#Separation of concerns#Deployment best practices

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice