I'm looking for some opinions on storing configuration data in a database versus in a file.
I notice that the majority of programs I've used seem to have a lot of their preferences and configuration settings stored in a file. Especially when dealing with PHP. But it would seem to me that if you're using a relational database and you're already making a connection to the database to serve a page or anything else, then why not suck your configuration information out of a config table?
Currently, I place a line near the top of my program that does a
selectrow_hashref() to grab configuration data. The only configuration settings outside of the database are placed in the script itself, and that's just the
connect() line.
I've been considering using
Config::IniFiles, instead. That might be overkill, though. Should I really
use all of that extra code instead of the simple one
selectall_hashref?
Or, are there other suggestions?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.