简体   繁体   中英

Sharing global variables across multiple servers/applications

I am looking to set up a central point of control for settings that exist across several web servers, server applications, and possibly even internal desktop tools.

The current situation is that I have a settings file on each webserver or within each application, with Global Variables defined: Admin Email, Where to store uploaded files, etc. Some settings (such as a global admin email to send error reports to) are pretty much Company wide. Other settings may be client or site specific.

I also want this this central DB to be able to keep tabs on who/what is accessing each setting. For example say I have a "ProcessedImageUploadFolder" setting, with a value of "\\\\ImageServer\\cache\\" that is used by 5 differnt web sites, but I want to change this setting, but looking at my central system, I see that theres a 6th server that I didnt think of that has also been requesting this setting (the calling app needs to identify itself to get a setting, so the DB can log it), just in case changing this setting for the 6th server would have an side effects.

Before rolling my own DB with a service to dish out and log the settings, I'm wondering if there are any libraries/apps that handle something like this already. Does anyone have any ideas if something like this has been done? What is this type of system called?

Perferably the solution would be in C#/SQL but if the only option was something like php or Java, I would probably use that as a base and port it.

Or am I going about this all wrong?

EDIT: This is not mult-tenancy. Some of the apps that would use this service are already in a multi-tenant set up. Others are one-off apps... others are desktop apps used on the local network or the VPN.

If anyone can tag this question better, be my guest.

A central database with a service seems like the way to go. Make sure that your applications cache the configuration, so that they won't hit the database on every request, and also so that they will be able to keep going if the central database is temporarily unavailable.

If Java is an option, you could take a look at Commons Configuration . You could also have a look at Profile Options in Oracle Applications (page 2-21) for some ideas. Profile Options have an interesting configuration hierarchy, where preferences may be set at the site, application, responsibility, and user level, with the highest level preference taking precedence.

I think the best term to describe your question Neil would is called "Multi Tenancy". Devlicious posted an interesting article on Multi Tenancy here: http://devlicio.us/blogs/anne_epstein/archive/2009/04/24/the-case-for-multiple-dbs-in-multi-tenancy-situations.aspx .

If I was coding a sshared configuration service I would try to implement using a pattern similar to the Service Locator Pattern http://martinfowler.com/articles/injection.html#UsingAServiceLocator and develop a web service that is easily extendible and easy to interop with. The service would abstract your design regardless of whether it is 1 database, 2 databases or multiple xml configuration files.

Does anyone else have any suggestions?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM