配置文件与数据库表 [英] Config files vs database tables

查看:125
本文介绍了配置文件与数据库表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我特别感兴趣的情况是具有运行在某些配置参数上的守护程序的多台服务器。 (因为这是一个学习练习,我欢迎任何超出这种情况的想法)
问题是配置参数应该在哪里。

The scenario I am particularly interested is multiple servers having daemons that run on certain configuration parameters. (since, this is a learning exercise. i welcome any thought beyond this particular case) The question is, where should the configuration parameters sit.

A。一个中央数据库表

A. a central database table

B。一个配置文件推送到每个框

B. a config file pushed to each of the boxes

这是我遇到的最常见的问题。值得注意的是,在代码常量(需要重新编译部署,所以坏选项,除非它们真的是常量),配置文件挂载在共享位置。

These are the most common I've come across. The notable others being, in code constants (needs recompile to deploy. so bad option unless they really are constants), config file mounted on a shared location.

只是想从社区了解您如何选择。

Just wanted to know from the community on how you go about making the choice.

推荐答案

这一切都取决于您正在管理的操作规模。

It all depends on the scale of the operation you're managing.

如果位置数量很大和/或更改频繁,请使用数据库。

If the number of locations is large and/or changes are frequent, use a database.

否则,使用配置文件。

如果访问集中式数据库太慢或者不可接受的一个故障点,但是规模仍然很大,请使用像Puppet这样的自动化系统。

If access to a centralized database is too slow or unacceptably a point of failure, but the scale is still large, use an automated system like Puppet.

这篇关于配置文件与数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆