Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Config files vs database tables

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 central database table

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.

like image 769
neal aise Avatar asked Jul 06 '10 22:07

neal aise


People also ask

Is it better to keep configurations in config file or database?

Multiple versions may require different key values. The bottom line is that if it's a large scale distributed environment, database is the way to go unless you have automated config file management system in place.

What is the purpose of a config file?

A configuration file, often shortened to config file, defines the parameters, options, settings and preferences applied to operating systems (OSes), infrastructure devices and applications in an IT context. Software and hardware devices can be profoundly complex, supporting myriad options and parameters.

What is configuration file in database?

The database configuration file (by default, named MFDBFH. cfg) is used by the native database file handler (MFDBFH), and for enterprise server region management. It contains a list of database server instances, the databases available within them, and connection details.

What is a configuration table in database?

Configuration Tables. Configuration tables are used for Things, Thing Templates, Thing Shapes, and Mashups to store values, such as property values, that do not change often. The most common use of configuration tables is to store credentials and host information for an external resource.


1 Answers

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.

Otherwise, use configuration files.

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.

like image 106
Borealid Avatar answered Sep 30 '22 21:09

Borealid