官术网_书友最值得收藏!

Configuration with environment variables

If you're familiar with the Twelve-Factor App or have worked with Docker much, you'll know that configuration may be done using environment variables rather than managing multiple disparate configuration files. According to The Twelve-Factor App (https://12factor.net/config):

"Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally; and unlike custom config files, or other config mechanisms such as Java System Properties, they are a language- and OS-agnostic standard."

Using environment variables for FaaS enables code deployments to different systems (dev, QA, production, and so on). Changing configuration can be as simple as updating a variable in your function's config. However, for safety and repeatability, environment variable changes should go through some process such as CI/CD to minimize the chance of errors.

On the flip side, if using file-based configuration, updating the application typically requires updating a file, possibly checking into source control and redeploying the entire application.

In my opinion, there is an enormous increase in productivity using environment variables when creating new systems or deploying between different systems. To perform a new stack deployment or update of an existing stack, you merely load up new environment variables and executes a standard set of steps that don't change between stacks. Due to the ease and speed with which you can do this, it encourages separation of stacks for different purposes (development, testing, production, and much more).

主站蜘蛛池模板: 仁寿县| 蓬莱市| 洞头县| 五峰| 科技| 和平县| 将乐县| 塘沽区| 民和| 富顺县| 大竹县| 嘉鱼县| 景德镇市| 西青区| 望奎县| 宣汉县| 绥滨县| 同仁县| 集贤县| 桓台县| 延安市| 西乌珠穆沁旗| 阿克陶县| 德格县| 沾化县| 南郑县| 横山县| 腾冲县| 犍为县| 博客| 彰化市| 历史| 大化| 哈密市| 赤城县| 舒兰市| 禄劝| 河间市| 达孜县| 江阴市| 明水县|