Your API URL lives in 3 dashboards. Which copy is right?
Most teams do not plan to spread one app across three services. It happens a service at a time, and then the same environment variable has to be set in every place the app runs. The Twelve-Factor App method puts config
Most teams do not plan to spread one app across three services. It happens a service at a time, and then the same environment variable has to be set in every place the app runs.
The Twelve-Factor App method puts config in the environment, apart from code, and asks you to keep development, staging and production as similar as possible. A database address is config too. The test it suggests is simple: your codebase should be openable to anyone without exposing a credential.
Sooner or later one copy drifts. An API URL that was updated in two dashboards but not the third. A key that was rotated in one place and left alone in two others. Nobody broke anything on purpose. The change was just made three times.
How to check it in 5 minutes:
- List the variables of each service in each environment.
- Compare them line by line.
- Any difference you cannot explain is drift.
How to reduce it: one source of truth for config, and rotate secrets from one place.
Source: The Twelve-Factor App, sections "Config" and "Dev/prod parity" (12factor.net).
Save this for your next deploy, and send it to the teammate who owns your environment variables.
Optivian is a cloud platform that deploys your frontend, backend and database from one Git repo. More at optivian.cloud.
cloudhosting #webdevelopment #backend #optivian
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.