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

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.

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

    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.

      I don't get it. How's that writing is not an issue, yet dragonchilds suggestion of reading it once isn't possible because the config file will be updated. What is it?

      In fact, the more I read, the more I get confused about your priorities. Reading in the config file needs to be efficient, yet the config file won't be updated often. It needs to be reliable and efficient, but a database can't be used. You're looking for alternatives, but it's unlikely your infrastructure will be changed. About any suggestion that's being offered is shot down because of "efficiency" or "reliability" reasons, or because of company politics. That doesn't give much leeway, does it?