473,626 Members | 3,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Configuration parameter in SQL database

Hi all,

For some reasons, we've had to move away from the configuration files and
are now storing all the configuration parameters for our applications in a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
applications vary can be web applications, web services, windows services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static members?

Some developpers in the team would rather use dynamic members so that any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our decision.

Cheers,

Stephane Varin
Jun 27 '08 #1
7 1429
Well, we have the same basic concept here with one of our tables that stores
general configuration data across our applications as well.

If you're storing those values inside static members on the objects the only
way you're going to allow them to update when the database changes is by
reloading the appdomain they're hosted in. Typically this involves restarting
the application or service that is running unless you're managing the
appdomains yourself, which can get very complicated.

I would agree with the developers on your team that want to store the
configuration data dynamically. Your solutions will end up requiring less
maintenance, which in turn gives you time to work on other things. When the
data has to change (which it probably will) you won't need someone to go
around restarting everything.

Just my opinion, but I'd have to agree with your team.

"StephaneVa rin" wrote:
Hi all,

For some reasons, we've had to move away from the configuration files and
are now storing all the configuration parameters for our applications in a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
applications vary can be web applications, web services, windows services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static members?

Some developpers in the team would rather use dynamic members so that any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our decision.

Cheers,

Stephane Varin
Jun 27 '08 #2
There is a middle ground; you could cache the values with a moderate
duration - even a minute or two would save a *lot* of round-trips, while
negating the need to reset the app each time. There are various cache
layers that could do this for you; even the System.Web cache can be used
standalone (since 2.0; not in 1.1). Or kust keep an expiry DateTime.

Marc
Jun 27 '08 #3
What about the overhead on our SQL server ?

The way I see it, our applications would be making tens of calls to this
database for each and every action, times the number of users...potenti ally
thousands of request to retrieve the same value over and over...

Do the benefits (avoiding the need to restart the application when a
parameter is changed) justify this culprit?

Configuration parameters are by essence fairly stable values, and the need
to change them usually arises when deploying a new version of the product,
which implies a restart anyway...

Well, I am very uncomfortable with this idea, I have to admit...

"Jeff Winn" wrote:
Well, we have the same basic concept here with one of our tables that stores
general configuration data across our applications as well.

If you're storing those values inside static members on the objects the only
way you're going to allow them to update when the database changes is by
reloading the appdomain they're hosted in. Typically this involves restarting
the application or service that is running unless you're managing the
appdomains yourself, which can get very complicated.

I would agree with the developers on your team that want to store the
configuration data dynamically. Your solutions will end up requiring less
maintenance, which in turn gives you time to work on other things. When the
data has to change (which it probably will) you won't need someone to go
around restarting everything.

Just my opinion, but I'd have to agree with your team.

"StephaneVa rin" wrote:
Hi all,

For some reasons, we've had to move away from the configuration files and
are now storing all the configuration parameters for our applications in a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
applications vary can be web applications, web services, windows services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static members?

Some developpers in the team would rather use dynamic members so that any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our decision.

Cheers,

Stephane Varin
Jun 27 '08 #4
Hello Stephane,

Thank you for the positive feedbacks of my initial reply.

The introduction of Caching in ASP.NET with the SqlCacheDepende ncy Class is
the MSDN article:
http://msdn.microsoft.com/en-us/library/ms178604.aspx
It depicts the main features of ASP.NET SQL cache dependency, and tells the
different implementation of the mechanism in SQL server 2000 and 2005: SQL
server 2005 has the built-in support of Query Notification, whereas, SQL
server 2000 replies on polling which is less efficient.

To use the SQL Cache Dependency in the environment of ASP.NET 2.0 + SQL
Server 2005, please follow these two steps:

*Step 1. (SQL Server) Enable "Query Notification" in SQL server 2005*
http://msdn.microsoft.com/en-us/library/ms172133.aspx
with the SQL command:

ALTER DATABASE [DB Name] SET ENABLE_BROKER;

Note1: Before the run of this command, please make sure all the SQL
connections of the DB are disconnected. Otherwise, the command will hang.
Note2: Certain versions of SQL server 2005 don't include Notification
services:
http://technet.microsoft.com/en-us/l.../ms143500.aspx

*Step 2. (ASP.NET) Write code to use SqlCacheDepende ncy*
http://msdn.microsoft.com/en-us/library/9dz445ks.aspx
This is a step-by-step demo of SqlCacheDepende ncy in ASP.NET. If you are
interested in how to use it in Windows application, please refer to:
http://msdn.microsoft.com/en-us/library/a52dhwx7.aspx

A frequently used tip is to put the code:
SqlDependency.S tart(GetConnect ionString());
Into global.asax Application_Sta rt function:

protected void Application_Sta rt(object sender, EventArgs e)
{
SqlDependency.S tart(GetConnect ionString());
}

When you call this method, the runtime sets up the relationship between the
application domain and the connection string that will be used later during
the notification registration process.

For more reading of SQL Cache Dependency samples:
http://www.writebetterbits.com/2008/...2005-database_
11.html
This is a good demo of SQL Cache Dependency with LINQ

By the way, you may find some articles like these online:
http://www.codeproject.com/KB/aspnet...ASPNET_20.aspx
http://www.codeproject.com/KB/web-ca...endencies.aspx
They are about SQL Cache Dependency for SQL server 2000, which requires the
commands:
aspnet_regsql -ed -E -d School
aspnet_regsql -et -E -d School -t Users
These are not necessary in SQL server 2005.

Please let me know if you have any other concerns, or need anything else.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====
Jun 27 '08 #5
SOmething else to consider.

Greg Leake has created a "mini framework" about this configuration setting
up.

http://msdn.microsoft.com/en-us/netf.../bb499684.aspx
Focus on the configuration framework, and less on the WCF.

Basically, if you update a config setting (in the db), it pushes out all the
information.

Not sure if that's what you're after, but he did alot of work on it.


"StephaneVa rin" <st******@newsg roups.nospamwro te in message
news:0A******** *************** ***********@mic rosoft.com...
Hi all,

For some reasons, we've had to move away from the configuration files and
are now storing all the configuration parameters for our applications in a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
applications vary can be web applications, web services, windows services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static
members?

Some developpers in the team would rather use dynamic members so that any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our
decision.

Cheers,

Stephane Varin

Jun 27 '08 #6
Hello Sloan and Stephane,

I agree that the "mini framework" in the .NET StockTrader Sample, i.e.
"Configurat ion Service", can be another consideration. As far as I know, the
source code of the configuration service is not published, so I cannot tell
its exact idea of the update callback. It might be using the similar
mechanism to SQL Cache Dependency. For more reading about the service,
please refer to the document:
http://download.microsoft.com/downlo...nicalGuide.pdf

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
SOmething else to consider.

Greg Leake has created a "mini framework" about this configuration setting
up.

http://msdn.microsoft.com/en-us/netf.../bb499684.aspx
Focus on the configuration framework, and less on the WCF.

Basically, if you update a config setting (in the db), it pushes out all
the information.

Not sure if that's what you're after, but he did alot of work on it.


"StephaneVa rin" <st******@newsg roups.nospamwro te in message
news:0A******** *************** ***********@mic rosoft.com...
>Hi all,

For some reasons, we've had to move away from the configuration files and
are now storing all the configuration parameters for our applications in
a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
applications vary can be web applications, web services, windows
services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static
members?

Some developpers in the team would rather use dynamic members so that any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our
decision.

Cheers,

Stephane Varin


Jun 30 '08 #7
Greg (Leake) has a new version out. It is more friendly then the first
version.
All code is available I believe.

At least that's what he said at TechEd2008.

"Jialiang Ge [MSFT]" <ji****@online. microsoft.comwr ote in message
news:uv******** ******@TK2MSFTN GP06.phx.gbl...
Hello Sloan and Stephane,

I agree that the "mini framework" in the .NET StockTrader Sample, i.e.
"Configurat ion Service", can be another consideration. As far as I know,
the source code of the configuration service is not published, so I cannot
tell its exact idea of the update callback. It might be using the similar
mechanism to SQL Cache Dependency. For more reading about the service,
please refer to the document:
http://download.microsoft.com/downlo...nicalGuide.pdf

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no
rights.
=============== =============== =============== ====

"sloan" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>SOmething else to consider.

Greg Leake has created a "mini framework" about this configuration
setting up.

http://msdn.microsoft.com/en-us/netf.../bb499684.aspx
Focus on the configuration framework, and less on the WCF.

Basically, if you update a config setting (in the db), it pushes out all
the information.

Not sure if that's what you're after, but he did alot of work on it.


"StephaneVarin " <st******@newsg roups.nospamwro te in message
news:0A******* *************** ************@mi crosoft.com...
>>Hi all,

For some reasons, we've had to move away from the configuration files
and
are now storing all the configuration parameters for our applications in
a
SQL table. We have developped a library to manage the access to these
parameters and all our projects are now using this component. Our
application s vary can be web applications, web services, windows
services,
even MS Office Addins.

Now here is the question that we are asking ourselves.

Shoud we or should we not keep the value of the parameters in static
members?

Some developpers in the team would rather use dynamic members so that
any
change to the underlying parameter in the table would be immediately
reflected without the need to restart the application pool in IIS or the
windows service.

Any comment or advice would be much appreciated to help us make our
decision.

Cheers,

Stephane Varin



Jul 3 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6460
by: Tom Martin | last post by:
I'm a Java Web developer NEWBIE that has inherited a website that fails every 2 hours due to poor connection pooling between Tomcat 4.0.6 and mySQL. In efforts to resolve this problem, I've created another replica DEVELOPMENT website and upgraded it to Tomcat 4.1.27. I was told this version of Tomcat supports Database Connection Pooling (DBCP) better than previous versions. I followed the instructions as listed at:...
7
1549
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 school project and I am in trouble. I have make a Python script called conf.py. This file contains dictionnarys for configuration like this: config_sql = { "DATABASE" : "nanana", "USERDB" : "bob",
2
1406
by: serge calderara | last post by:
Dear all, I have a windows application linked to a database. I was wondering about one point. Do I have to go for a configuration file anyway or can I store all my application in this database. I could use only the database but is it something good compare to configuration file?
0
3670
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the mysql- connector-java-2.0.14-bin.jar in commons/lib. The application runs normally, and usually about once or twice a day I get this exception org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server configuration denies access to data...
1
2753
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks like: ================================================ <?xml version="1.0" encoding="utf-8" ?>
1
1663
by: Mark | last post by:
In the "Adminstration: Performance" manual (DB2 V8.1 for LUW), it describes the following dbm (database manager) configuration parms. Since these are set at the dbm level, do we calculate the combined number needed for all databases in the instance, or does each database get their own allocation of these? - Maximum Number of Agents (maxagents). - Agent Pool Size (num_poolagents).
3
5412
by: Mark | last post by:
In a DB2 V8.1 performance tuning document from a 3rd party vendor, I found this statement. Can anyone verify this? "DB2 requires 100 bytes of memory for every buffer pool and extended storage page that is allocated to a database for use as a descriptor in the database heap, so the size of the DBHEAP configuration parameter should be considered before creating large buffer pools. For example, a 1 gigabyte buffer pool with a page size of 4...
2
4792
by: Patrick | last post by:
I am using the Microsoft enterprise Library (June 2005) with .NET Framework 1.1 on a Windows 2003 IIS6 web server. with an ASP.NET 1.1 application, I have a dataConfiguration.config as listed at the end of this post(configured with the Enterprise Library Configuration Tool) I have this file in a "production" environment and what I found is that if I use the SQL Server 2000's Enterprise Manager's Current Activity viewer under the...
10
5589
by: Woody Ling | last post by:
In 32 bits DB2 environment, is it meaningful to set sheapthres larger than 256MB for the following case.. 1. Intra-parallel is ON 2. Intra-parallel is OFF
0
8265
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6125
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.