in reply to Configuration Storage (Perl Vars) in Database

Flat files have the advantage of being easily accessible. Just start an editor and you can see and edit everything. But why use a database then? A database allows fast access to selected subsets of structured data (i.e. data you can put into rows and columns and every row has a similar item in a specific column)

But where is the structure of a hash or array you dumped with Data::Dumper? It is just one long string that you can store in a column of this table and read out one piece or write in one piece. Normally that can be done with a flat file faster and better.

So the question is, what do you hope to achieve better with a database than with flat files ?

It might be that many of the arrays are shared between different config files. Then Data::Dumper or YAML might make sense.

Or you need insertion or reordering inside the arrays a lot. Or maybe you are after statistical data. In those cases you would have to store each array element in a row of the database. Might make sense, but a bit far fetched.

As you can see I have a hard time finding reasons why a config file should be stored in a database. If you have a convincing reason we could tell you how to do it elegantly

  • Comment on Re: Configuration Storage (Perl Vars) in Database