• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read configuration from database instead of a config file

 
Pavan Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have been working on stand alone application that reads application configuration from properties files.

I was thinking if it would be a better idea to store them in a table in the database.

This way, changes would be propagated faster
if we need to update a particular property, we don't necessarily have to go through the whole release cycle.

But this could be a disadvantage as well, as we are introducing un-tested features.

But these configuration changes do not happen often and if ever it happens we would actully know the risks.

What are your thoughts and experiences on this?

I would appreciate if someone throws some light on this.

Thanks,
Cnu
[EDIT] fixed subject to be more meaningful ( I think )
[ September 28, 2006: Message edited by: cnu sri ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I introduced a configuration database table for just the reasons you describe, plus one more. Our deployment people want to deploy an EAR file and nothing else. So the config files must be in the EAR and since we cannot modify the EAR that makes them the same in all environments: test, qa, s&p, training, prod, etc. We have quite a few things that must vary in each environment, so those go in the database. It's set up so a configuration file overrides the database. That lets a developer customize his own environment through files without changing a shared database. The configuration module has a lazy cache to improve performance and an administrative dashboard to clear cache and bring in changes.

Any of that sound good?
 
Pavan Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stan,

Thanks very much. Yes, that definitely feels more assuring. Specially the idea of overriging the default properties with a config is very cool.

Thanks,
Cnu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic