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

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).

主站蜘蛛池模板: 大名县| 澄江县| 漳浦县| 纳雍县| 宁晋县| 安新县| 集贤县| 故城县| 榆林市| 衡东县| 平顶山市| 文化| 尼玛县| 鄂尔多斯市| 大渡口区| 肃宁县| 彩票| 灌云县| 亳州市| 高台县| 寿阳县| 新源县| 宿迁市| 定南县| 宜春市| 房山区| 曲水县| 大庆市| 尼木县| 柞水县| 清镇市| 芦山县| 石棉县| 齐齐哈尔市| 海城市| 台江县| 石泉县| 洪雅县| 汝阳县| 台州市| 兴安盟|