in reply to Re^2: Configuration Files
in thread Configuration Files

Let me paraphrase what I hear you saying:
  1. I've got a problem that says "Use a database to solve me"
  2. I don't want to use a database
  3. Any suggestions?

Seriously, you really want to use a lightweight database solution for this. Something like MySQL, SQLite, or BerkleyDB.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^4: Configuration Files
by Mutant (Priest) on Nov 02, 2004 at 16:41 UTC

    There are two reasons why I'm not using a database (a database was my initial thought as well). Firstly, reliabilty is crucial. The system does write data to a database, but should that database be down, it has other (multiple) mechanisms so that no data is lost. I could possibly do something similar on the config side (ie. have a failover config file, but normally read out of the database), and that might not be a bad option, but I'm wondering if there are any others.

    The other reason is mainly political - the current application doesn't use a database for it's config (although it's woefully inefficient), but it's realiable (ie. there's no DB server to go down). Reliability is above efficiency in this project..

    The ideal would be to have some sort of High Availability Db server in place, but that infrastructure doesn't currently exist. Hopefully, I can do this in the future, but currently my hands are tied.

      In my experience, databases (well, good databases, not toy things like MySQL) are far more reliable than file systems. Sure, your database could not be available, but so could your filesystem. And your database will not corrupt your configuration data if your application dies halfway writing the configuration file. Rest assured that anything based on doing simple write(2)s will happily leave your data in a corrupt state if the application dies halfway. Or worse, if the application dies after thinking it finished writing the data (but alas, some of it was still in a buffer somewhere).

      Using your filesystem instead of a database for reliability is like "going to war for peace" or "fucking for virginity". Larry Ellison wouldn't be as rich as he is now if filesystems were as reliable as databases.

      The ideal would be to have some sort of High Availability Db server in place, but that infrastructure doesn't currently exist. Tell, you do at least have a HA filesystem? And your application itself is running in a cluster? Otherwise, all you will be doing is window dressing.

        Actually, writing is not an issue, since the config is actually stored in a DB (albeit MySQL) until it's ready to be 'published'. And yes, the application itself runs on 7 servers. (Don't ask me why the DB only runs on one...).

        All things being equal, I would use a DB and wouldn't even bother posting this here, but I've inherited an infrastructure that's not ideal (as is not likely to be changed much anytime soon), and also expectations on reliablilty inherited from the legacy application. I take your points though.