473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
2 1668
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Famille Delorme | last post by:
Sorry if this discussion are already submited, but I don't find anything really interresting for me. And sorry for my bad english, it is not my native language. I wrote a program in Python for a...
0
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
11
by: Tom | last post by:
I am planning on adding a Preferences form to my application and using the Property Grid to display the preferences to the user. What do you think would be the best way to save these preferences...
7
by: Kirk | last post by:
Hello, I am trying to find a VB.NET method that will allow me to save and read an application's settings in a separate file located on any drive, any folder. I have found a couple of methods...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
1
by: WebCM | last post by:
We can do it in different ways. Configuration data are sent by POST. Some of them should be parsed before saving to file. Perhaps, I will use var_export(). However, how to do it best? 1....
0
by: jordonkraft | last post by:
Hello, I have been searching the net, MSDN, google groups and can't seem to find anything about what is happening to me. I have developed a application using VB.Net 2.0 and deploy it using...
5
by: akshaycjoshi | last post by:
Ok ! I am reading the book Pro ADO.net. The author says that the <exename>.config files can store the connection string for security purposes. Later he says that still the connection string...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all, i have app.windows .NET that open an app.config from a Windows service for modify values. The app.config of service uses EntLibrary Exceptionhandling and Logging. My code for modify...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.