views:

241

answers:

3

We are designing a client/server program and I need some help with a design decision.

The server side of the program will run as a service on a number of Windows servers, the service is monitoring those servers, when needed the service will email us a report.

The client will be used to control and manage the services running on the servers, but won't always be running.

My question is where and how should I store the configuration for the service. The settings (smtp etc) will be defined on the client but the services running on remote servers (there may be many) need to be updated with the settings and also retain those settings unitil they are updates again.

I can think of two options, a central Windows Share where the services read the settings from or when the client hits 'Save' the settings are saved to a location on each server.

What would you do? Anything I should be aware of?

Thanks

A: 

Hi

I don't have experience with such services but a suggestion might be to store settings in a central database they all have access to. So each time you create a new server you create a new settings entry in the database.

Just throwing this into the discussion.

The real napster
A: 

I have developed a system that involves a client and several servers. The requirements for my system include that it be very reliable and highly available (which may not be your requirements). From that point of view, here are some thoughts:

  • If you store the settings in a central location - either a file share or a database - you have created a single point of failure in your distributed system. A workaround would be to store the settings in 2 or more central locations. But, how do you ensure that the 2 or more locations are in sync?)

  • If your store the settings with each server, what if the client/server communication fails with one server at the moment when you are trying to save the settings, or what if one of the servers isn't up. Now you have a situation where the servers don't agree about what the settings are. So, again, how do you ensure that the multiple servers are in sync?

  • So.... think about how you can reliably keep the servers in sync, and how they can detect when they aren't in sync. In my system, there is a master/slave scheme between the servers, heartbeats with sequence numbers so that slaves can constantly assure themselves that they are in sync and haven't missed a message. If the master is down, the system degrades, but still works too, so that master is not a single point of catastrophic failure.

Corey Trager
A: 

There are number of things to consider here.

The obvious choice is a repository whether it be Registry, file, Database at server end. And when your service loads you fetched all these settings in a collection. However what happen when you add one more service at server end for let say monitoring some other tasks.

Now you are in problem since if the parameters got updated in the databse through one server the other service/s needs to be informed of the update and they need reinitialization.

You can over come this by introducing many IPC machenism i.e. Queues, Shared Memory, Pipes, Sockets between many of the services. I would suggest Shared memory if services are not distributed or Queues on a central server or a database if it's not; as a better options. However services still needs to collaborate some how to give a hint to other services about the updation of the parameters.

S M Kamran