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

M

Mufasa

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.
 
M

Mark Rae

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...
 
M

Mufasa

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top