Avoid Default Configuration Values
Context
Microservices are being adopted. Configurations can be changed at deploy or runtime. Configuration values are bestowed with default/fallback values.
Problem
- There is no awareness for changing some configuration values at deployment since they are not enforced, leading to wrong configurations.
- The deployed instances crash due to their wrong configuration.
Solution
Avoid default configuration values to enforce their explicit configuration and fail fast in their absence.
In general, the configuration mechanism should fail if configuration values were not supplied. In combination with not using default values, the deployment will always fail if configuration values were forgotten. This mechanism contributes to the fail-fast characteristic of fault-tolerant microservices.
Maturity
More data required (only 1 source).
Sources of Evidence
Interview A:
- Example: developer uses test database on localhost as dependency
- deployment to production => crashes
- or even worse: no failure message because default value is set => crashes in production instead of failing at deployment
- was a challenge for them to establish this consistently