By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,128 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Saving configuration items in a .config file vs in a database.

P: n/a
Can anybody give me an opinion on which is more efficient -

Saving parameters in a database that is on the same machine as the web site
or
Reading parameters from a .config file ?

It seems like the constant opening/closing of the connection would be a
congestion spot - plus it would use lots of memory.

But when you have the options in a file - is that slow there?

Is this a spot where a cache would be appropriate ? I would like it for both
web services and for a web site. In theory I could load the cache when
somebody goes to the login page and then read from then on. But how do I
update it when new values are stored? The values don't change that often.

TIA - Jeff.
May 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Mufasa" <jb@nowhere.comwrote in message
news:ex****************@TK2MSFTNGP06.phx.gbl...
Can anybody give me an opinion on which is more efficient -
Saving parameters in a database that is on the same machine as the web
site or Reading parameters from a .config file ?
Not without a bit more information about the data, how often its accessed
etc...
It seems like the constant opening/closing of the connection would be a
congestion spot - plus it would use lots of memory.
If you are talking about the connection to the database, then opening and
closing it whenever it's needed is by far the most efficient method, thanks
to connection pooling.
But when you have the options in a file - is that slow there?
Again, it depends...
Is this a spot where a cache would be appropriate ? I would like it for
both web services and for a web site. In theory I could load the cache
when somebody goes to the login page and then read from then on. But how
do I update it when new values are stored? The values don't change that
often.
If the data is fairly small, doesn't change very often and is the same for
all users, I would certainly consider storing it in the Application cache...

As for updating it, just build an administration page...
--
http://www.markrae.net

May 2 '07 #2

P: n/a
Do webservices have an application object? I think that's where I'm more
concerned - I have webservices that get called 10-15 times a minute that are
reading from the DB configuration options. Would be nice to read them once
and be done with it.

TIA - Jeff.

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"Mufasa" <jb@nowhere.comwrote in message
news:ex****************@TK2MSFTNGP06.phx.gbl...
>Can anybody give me an opinion on which is more efficient -
Saving parameters in a database that is on the same machine as the web
site or Reading parameters from a .config file ?

Not without a bit more information about the data, how often its accessed
etc...
>It seems like the constant opening/closing of the connection would be a
congestion spot - plus it would use lots of memory.

If you are talking about the connection to the database, then opening and
closing it whenever it's needed is by far the most efficient method,
thanks to connection pooling.
>But when you have the options in a file - is that slow there?

Again, it depends...
>Is this a spot where a cache would be appropriate ? I would like it for
both web services and for a web site. In theory I could load the cache
when somebody goes to the login page and then read from then on. But how
do I update it when new values are stored? The values don't change that
often.

If the data is fairly small, doesn't change very often and is the same for
all users, I would certainly consider storing it in the Application
cache...

As for updating it, just build an administration page...
--
http://www.markrae.net

May 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.