Enterprise Software Configuration Made Simple

Enterprise Software Configuration Made Simple

n organized system for maintaining and delivering configuration information is an essential component of any enterprise software system. For small enterprises with only a few servers, registry entries and individual configuration files offer a very simple configuration management solution; however, as the size and complexity of an organization grows to include many computers running across several physical locations, keeping all the related software components configured correctly quickly becomes a serious challenge. This article describes the various storage strategies available for storing configuration information, and then proposes a configuration system that you can easily implement yourself.

First, consider the attributes required to provide a useful system for managing configuration properties for a large enterprise of servers and software components. The following list prioritizes some key characteristics of such a system.

  • Centralized Storage and Management. Whether the actual settings are stored in a central location or whether a tool provides the appearance of centralized storage, settings should be managed from a central location.
  • Localized Settings. The system should be able to assign property values to the module, server, or location where the software will operate?for example, to a specific piece of software (the module)?more generically to a hosting server, or even more generically to a location (a physical location such as a primary datacenter or a disaster recovery facility). This feature supports (for example) setting a log file directory at the server level (all software modules on the same server will log to the same directory) and assigning an error reporting web service at the location level (all software modules running on all servers at a location will share the same value).
  • Reliability. Even in the event of occasional network or database failures, the software components must be able to obtain the configuration information required to operate “properly.” While it’s likely that the software will not be able to perform fully during such failures, the available configuration should at least give it the capability to log errors, reroute messages to operational components, or queue work requests until the disturbance has passed.
  • Scalability. Even when high numbers of servers and software components are reading configuration information very rapidly, the configuration system should scale with increasing demand.

Storage and Distribution Strategies
Historically, there have been four main ways of storing software configuration information: the registry, .config and .ini files, centralized databases, and custom text or XML files. These strategies all have their strengths (measured in terms of ease of modification, tools availability, retrieval speed, etc.) but they all become problematic as the size and complexity of the enterprise software environment grows (see Table 1).

Table 1. A comparison of the most popular storage strategies for configuration information shows their relative strengths and weaknesses.
Storage Pros Cons
Registry Local storage, fast reads, and immune to network and database failures Large numbers of servers can be very burdensome to maintain
Config files Local storage, fast reads, and immune to network and database failures Very difficult to maintain due to lack of tools
Centralized database Centralized management Slow reads, difficult to scale to high numbers of servers
Custom files Local storage, fast reads, and immune to network and database failures Very difficult to maintain due to lack of tools

Building a Configuration System
The configuration system described here has two main goals: central configuration storage, and enterprise-wide configuration property distribution.

Author’s Note: This article uses the following terminology. A “module” is any logical piece of software that is operated?or more importantly?configured, as a single entity. A “location” is either a physical or logical group of servers that are configured similarly. A “property value” is a named piece of information affecting the operation of a software system.

Storing Configuration Data
Before investigating the process of making configuration data available to distributed software components, you need to understand how the data is stored centrally. The configuration system allows a property value to be assigned to any (or none) of the following elements: software module, server, and location.

Figure 1. Data Model: The data model for the proposed configuration system supports linking property values to modules, servers, and locations.

Figure 1 shows the data model for the proposed configuration system. The escProperties table gives each property a name (the PropertyLabel field) and defines how often to update the local “caches” of these property values (the ValidFor field). The escModules table defines the various software modules that comprise the enterprise system. The escServers and escLocations tables define the servers and locations that operate as part the of the enterprise software system. Note that the foreign key relationship between the locations and servers tables lets the configuration system automatically detect the location given a server name.

In the center of Figure 1, the escPropertyValues table provides a way to assign values to properties. The tables’ construction allows a property value to vary depending on the associated module, server, and location. To support property value assignments made without associating them with a specific module, server, or location, you may supply a zero for those values; this gives the table a wildcard matching capability. As an example, inspect the set of escPropertyValues records shown in Table 2

Table 2. Sample escPropertyValues: Here’s a sample set of property values that illustrate how a query can retrieve a specific or generic property.
PropertyID ModuleID ServerID LocationID PropertyValue
1017 1113 729 2239 \SVRNAMElogfilesabc
1017 0 0 2239 \SVRNAMElogfiles
1017 0 729 2239 \OTHERSVRNAMElogfiles
1017 1113 0 2239 \SVRNAMElogfiles123
1017 0 0 0 \SVRNAMElogfilesapp01

The first record in Table 2 holds a property value of \SVRNAMElogfilesabc for a property with the ID 1017 belonging to module 1113 running on server 729 at location 2239. Similarly, the second row provides the property value \SVRNAMElogfiles for a property with an ID of 1017, for any module (0) or server (0) at location 2239. Row 3 returns \OTHERSVRNAMElogfiles when any module running on server 729 at location 2239 requests the value of property ID 1017. Likewise, when module ID 1113 requests the value for property 1017 running on any server at location 2239, the return value will be \SVRNAMElogfiles123. Finally, the last row demonstrates a full wildcard record?the value \SVRNAMElogfilesapp01 will be returned to any module requesting the value of property 1017 anywhere in the enterprise.

When querying for a property value record, client software must provide the module ID, the server name, and the name for the value it’s attempting to retrieve. The escServers table’s relationship with the escLocations table provides the location of the calling server. Using these values, the SQL query shown below will retrieve the most specific property value based on the input data:

   SELECT       TOP 1 PropertyLabel, PropertyValue, ValidFor   FROM       eacPropertyValues pv       JOIN eacProperties p ON pv.PropertyID = p.PropertyID       LEFT JOIN eacServers s ON pv.ServerID = s.ServerID       LEFT JOIN eacLocations l ON s.LocationID = l.LocationID    WHERE       p.PropertyLabel like 'Log File Location'      AND (pv.ModuleID = 1017 OR pv.ModuleID = 0)       AND (s.ServerName like 'CORP_SVR' OR pv.ServerID = 0)       AND (pv.LocationID = s.LocationID OR pv.LocationID = 0)    ORDER BY       pv.ModuleID DESC,       pv.ServerID DESC,       pv.LocationID DESC

To select only the records that are relevant to the client’s request, the query filters only records that either match the specified search criteria exactly, or whose field value is 0 (the wildcard setting). In the preceding query, the three filter expressions in the WHERE clause that reference the module, server, or location provide this functionality. Notice that each clause matches either the specific value provided by the client or a wildcard value.

To select the record that is most specific to the search criteria specified by the client, the query gives precedence to criteria matches in the following prioritized order: module, server, location?by ordering the result set by ModuleID, ServerID, and LocationID in descending order. Non-zero settings values sort higher in the results, which means that by selecting only the TOP 1 record, the query result is the single property value result that applies most specifically to the software retrieving the property value.

Together, the tables illustrated in Figure 1 and queries formulated like the one shown above provide a basic system for retrieving the most appropriate configuration data from a central location, and fulfill the primary goal of providing a flexible configuration system. This method allows users to assign a property value either specifically or non-specifically as appropriate. Obviously, it wouldn’t be difficult to write a simple configuration tool that would help users make such property assignments.

Remember, one primary goal of a configuration system is to provide centralized management. The proposed configuration system is based on a centralized SQL Server database. As discussed in the previous section, though, this can lead to scalability problems with large numbers of client systems. Even more troubling, when database or network connectivity fails, client software will be unable to retrieve any configuration information, leading to software failures throughout the enterprise.

To solve that problem, the next phase of this article discusses a strategy for taking the configuration values from the centralized database and distributing the values to all the client servers.

Distributing Configuration Values
The proposed system contains a very simple caching methodology to enable values retrieved from the centralized database to be stored locally on the client servers for later retrieval. To make the process simple and flexible, the simple class framework illustrated in Figure 2?helps local clients read configuration values from the centralized database, store them in a local cache (the Windows Registry), and keep the values updated appropriately.

Figure 2. Property Class Framework: This extensible class framework manages both remotely and locally cached property values.

This configuration caching strategy provides another important advantage. In the event that the central storage system is unavailable at the time of application startup, when many application configuration values are traditionally retrieved, the application will either not be able to start or will be left in a precarious state. Using a persistent local cache results in higher availability.

Figure 3. Property Value Flowchart: This flowchart depicts the nominal flow that results when a client reads a property value.

At the heart of the framework is a PropertyValue class that client applications use to read property values. The clients can remain unaware that configuration information is managed remotely and cached locally. Under the covers, the PropertyValue class first checks the local cache for the requested property value. If the value is found locally, it quickly returns the value to the client; otherwise, the class retrieves the value from the central database, stores it locally, and then returns the value to the client. Figure 3 shows the high-level flow used by the PropertyValue class.

The PropertyValue class has a Lifetime property that determines whether cached values have expired. Expiration, in this case, simply means the value should be re-retrieved from the central database. This aging process forces periodic updates to the local copies of property values across all the machines in the enterprise. The escPropertyValues table’s ValidFor field contains the number of seconds before a local property value must be refreshed. When a client requests an expired value, the class refreshes the value from the central database and updates the local value before returning the value to the client.

To cover situations when the central database is unreachable, the class behaves as follows:

  • When a property value has not yet been stored locally, the PropertyValue class returns a null value.
  • When a property has been stored locally, but has expired, the PropertyValue class returns the locally-stored value.

This scheme serves both to keep data as current as possible, and makes it highly likely that a requested property value will be found locally in the unlikely event of an unreachable central database server.

Many readers may protest that the solution proposed here implements the central repository using SQL Server. Even more may protest using the Windows Registry as the local repository of cached property values. I could argue that these are probably the best all-purpose choices for these storage choices. However, the class framework displayed in Figure 2 supports pluggable interchangeability of both the local and remote storage mechanisms. In most cases, I would argue that SQL Server or another enterprise-class relational database is usually the best choice for the central repository for property values. However, in cases where a server hosts mostly web applications, it may make more sense to employ the ASP.NET cache for local storage.

The extensibility mechanisms built into both the LocalStorageClient and the RemoteStorageClient work nearly identically. You can quickly extend the framework to support other local and remote storage mechanisms. For example, suppose you want to store local configuration properties in an XML file. Here’s the procedure.

First, create a new class that inherits from LocalStorageClient, and implement the two mustoverride methods: LocalPropertyValue_Get and LocalPropertyValue_Set. These two methods read and write PropertyValue objects locally. To use an XML file for storage, you will need to write code to support opening and closing the XML file, reading and writing to the XML file, and so forth. The BuildPropertyValue method of the LocalStorageClient base class aids in building a PropertyValue class from the values retrieved from the XML file.

Note that there’s no reference to the mechanism used by the RemoteStorageClient. Nor is there any code used to check whether the locally stored value has expired. That’s because the PropertyValue class handles those tasks. If a property value must be updated from remote storage, the PropertyValue class coordinates the interaction between the RemoteStorageClient and LocalStorageClient as shown in Figure 3.

Using the Sample Project
The downloadable sample code contains a fully functional project that retrieves property values from a central SQL Server database and stores them locally in the computer’s registry. The property values stored locally honor the ValidFor setting in the escPropertyValue table by updating the local cache from the SQL Server system as specified.

A call to the PropertyValue class’s GetValue shared method functions is the entry point into the system. You only need to pass GetValue a ModuleID and the name of the property you want to retrieve. The RemoteStorageClient class retrieves the server name, and the tables using the server name can infer the location. The system will return a PropertyValue object for the requested property if that property value can be retrieved from either local or remote storage.

Populating the Tables
Initially, to populate the database tables, create escProperties rows for each property you plan to implement. Do not create a property row with a property ID of zero?wildcards are not supported in the property name. Property values will vary widely from one enterprise to the next, but most facilities are likely to have property labels such as LogFileLocation, DebugLevel, and ErrorReportingWebServiceURL.

Next, create a row in the escModules table for each module you want to configure separately. You will also want to create a wildcard row with a ModuleID of zero. My recommendation is to create a module row for every assembly you run on a machine?not just for executables. This will allow you to add specific configuration information for each piece of software on the system.

Finally, add rows to the escServers and escLocations tables for each server and location in your enterprise. Also add wildcard rows to both of these tables for the reasons described above.

The downloadable code includes a sample client application, named escTest. You can use this client to help understand how the framework operates, and to test new local and remote storage frameworks. You can also use it to verify that the SQL Server database has been configured correctly.

After you have retrieved several values and have verified that subsequent retrievals are being returned from the local cache, open the registry and inspect the local property values. Using a registry editor, navigate to HKEY_Local_MachineSoftwareEnterpriseSoftwareConfiguration. You should find sub-keys for each ModuleID used to retrieve property values. Under each ModuleID sub-key, you will find separate sub-keys for each property label whose values have been retrieved. The PropertyValue and ValidUntil registry keys are stored under the property label sub-keys. Figure 4 shows the “Log File Location” property for ModuleID 1003 stored hierarchically in the registry.

Figure 4. Local Registry Store: The LocalStorageClient_Registry class stores property values hierarchically using the ModuleID and PropertyLabel properties.

One implication of storing all property values under the module ID is that property values shared by all modules (those with a ModuleID of 0 in the escPropertyValues table) will be stored redundantly. In other words each ModuleID that queries for the same property value will store its own copy. That’s an acceptable price to pay, because it has several advantages. In addition to being a very simple way to implement the storage, this storage scheme also simplifies the process of debugging property value storage. Bear in mind that just because a value can be assigned a ModuleID of zero doesn’t mean that all instances of the property value will be the same. The model supports setting a generic property value with a ModuleID of zero, while still letting selected modules have a specific value for the same property.

You should also note that use of the registry for local cache storage is available only on Windows platforms. Other platforms will require a different local storage solution.

Implementing the Project in Your Enterprise
I have intentionally kept the functionality and source code of the sample project simple to illustrate how the system can work flexibly in any organization. Before you implement it, be sure you’re doing it for the right reasons. Remember that the proposed framework is not intended to help cache frequently used application data; in other words, don’t consider it as a general-purpose cache. Many of the techniques used to build the framework are borrowed from such caching designs, but you’d have to optimize the design of the local and remote storage clients differently for higher-volume use or for storing larger chunks of data. As described here, the system functions solely as an alternative to managing software configuration via the registry and/or .NET’s app.config files.

In addition, you should consider making at least some of the modifications in the following list before deploying the project in your organization:

  • It would be useful to create a basic web-based configuration tool to make configuration easier for the end-user. The tool should support the use of wildcards in property value assignments.
  • If you do not use SQL Server, you should add a RemoteStorageClient class specific to your central configuration repository. Whether you’re modifying the code to use Oracle, the registry, or LDAP, you will find the modification process straightforward, and similar to the client repository modification discussed in this article.
  • If your enterprise operates on several different platforms, such as Windows 2000, Windows 2003, or Linux, consider adding an escPlatforms table and a Platform column to the escPropertyValues table so you can support specific property values for each platform. If you do that, remember to link the escServers table to the new escPlatforms table in a manner similar to the link between escServers and escLocations.
  • If you operate from a single location, consider removing support for the escLocations table to simplify queries and configuration.
  • If you aren’t happy with the prospect of using the registry to store locally cached property values, consider adding a LocalStorageClient to support whatever local storage mechanism you wish.
  • Consider adding support for more than one type of LocalStorageClient. As mentioned previously, if the bulk of the applications on a machine are ASP.NET applications, it may make sense to use ASP.NET’s built-in caching for local storage. If configured properly, you could modify the LocalStorageClient’s base class factory method (GetLocalStorageClient) to return a different LocalStorageClient implementation depending on the client application’s identity. Keep in mind, using a strictly in-memory local cache will not help in cases where the application stops and restarts. In such cases, the cached values are lost and will need to be reseeded locally.
  • Depending on how your applications are configured, you may consider adding an attribute to the escPropertyValues and/or escProperties tables to support “critical” properties. As coded in the sample project, the normal operation of the LocalStorageClient for a property that cannot be refreshed after its ValidFor period ends is to return the expired property value. However, you could alter this so that when a property marked “critical” expires, the system would return a null value when the property cannot be retrieved from the central repository.
  • Using your enterprise’s standard error reporting framework, add support for logging errors when trying to retrieve values from the repository. Error reporting was not implemented in the sample project to keep the project simple.
  • Don’t be limited by the perception that a configuration value is generally assigned to a module. While most modules will represent a physical piece of software, it can also represent an instance of a module. For example, if you have a service that loads multiple instances of the same or similar assemblies, then the configuration for the service could instruct to load specific modules?each of the modules it loads reads their specific configuration settings. Extension of this idea will add greatly to the ways this system can be used to configure your enterprise systems.
  • You could implement a local Windows service to help by pre-fetching property values before they expire. By retrieving property values before they expire, the client application will seldom experience the additional delay caused when a local property value must be refreshed.
  • Using the Windows service described above, it would probably be helpful to probe local storage, removing property values that are more than a month old. These values are probably not used any longer and should be removed from the system
  • One problem with caching property values locally is that they become out of date when the master copy of the value in the central repository changes. For example, if the ValidFor property is set to one hour, you will likely have servers running with old values for up to an hour. Therefore, another use for a local service would be to receive notifications when property values should be updated immediately. With such a service, you could reduce the time required to push new central values to all the client systems to mere seconds.
  • One weakness in the implementation of the sample project is that when the central database is unreachable, all attempts to retrieve expired property values will block, waiting for the database connection to time out. To keep the local storage client responsive, you should implement a flag in the local cache that prevents unnecessary connections to the database when it is known to be unresponsive. As an example, using the registry version of the local storage client, you could add a flag to the root of the EnterpriseSoftwareConfiguration sub-key to indicate that the central database is unresponsive, along with a time after which the system should try connecting again. In this scheme, all attempts to read from remote storage would return null, meaning that property requests would simply return the version stored in the local cache. The flag would limit attempts to access the central database. For example, assuming you set the flag to one minute, only one client per minute would attempt to access the database while it is marked offline. The first client that successfully makes a central connection and retrieves a property would clear the flag, and normal property refreshes would resume.

As your organization grows, you will almost certainly feel the pain of keeping software configuration properties on multiple servers synchronized. Consider using the project provided in the sample code as a starting point for building your own enterprise-ready software configuration framework, extending it to fit the specific needs of your enterprise.



Share the Post:
Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India,

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not

Cybersecurity Strategy

Five Powerful Strategies to Bolster Your Cybersecurity

In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies

Global Layoffs

Tech Layoffs Are Getting Worse Globally

Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data

Huawei Electric Dazzle

Huawei Dazzles with Electric Vehicles and Wireless Earbuds

During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting

Cybersecurity Banking Revolution

Digital Banking Needs Cybersecurity

The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising

FinTech Leadership

Terry Clune’s Fintech Empire

Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned

The Role Of AI Within A Web Design Agency?

In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing

Generative AI Revolution

Is Generative AI the Next Internet?

The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These

Microsoft Laptop

The New Surface Laptop Studio 2 Is Nuts

The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1