Question

I have for the first time the need to update a service without any interruption. So far i had to stop the application on IIS then replace the files and then restart the application. I need to be able to hot swap this service for a new one on the fly. I will only need to add new methods or correct code inside existing one. In no way i will ever change the currently existing methods parameters. If need be i'll create brand new methods and my app will slowly be changed to point to new one.

My problem right now is that service uses other services and together they form a very high security system and if i stop that service for more than 8 seconds every people using the applications at the moment are getting kicked out. Other services internally do communicate within the network with that service as well for authentication for every single action a user perform on any of our applications. So we have WAN and LAN calls. Since it's a 3 step authentication (maybe 4 later one if we integrate federated credentials) and if one is off everything cut off.

I was wondering if there is a solution to that ?

I was thinking of a front service with connection to 2 services. One being the Live Service and the other the backup. when i wan to update i cut the Live and the front end will detect no connection on Live service and will fall on the backup one. Then i replace the live and put it online again and the front end will start to read the live again. Couple hours later i can replace the Backup with a copy of the live for the next update. Anyhow this still cause me the problem that the front end would need implementation of the new service each time.

Was it helpful?

Solution

You could create an identical application and redirect users to this by using a DNS change or a simple redirection in IIS before you make a change.

You mention internal users suggesting that the app is only used internally? If so you could force a DNS change on your domain/network to the new app and they will never know the difference. In the meantime make the change to your 'live' app and then do the reverse DNS change back again.

Failing that you could always perform the change out of hours. Every application requires a maintenance window every now and then.

OTHER TIPS

The only chance to achieve this (so i think) is the following:

You keep all your logic (which will be updated) in a separate library, which is dynamically loaded (and unloaded [keyword: separate AppDomain]!!). So for (bad) example, you could reload this assembly each time you call a method. This way cou could replace this dll on the fly without having to stop the service.

But this also has some disadvantages: For example this will slow down performance. Further you will have to implement your own security checks (that no malicious hacker, cracker or whatever can replace your library with one containing dangerous code.

Unfortunately this is the only alternative I'm aware of. I hope this could help you a little bit.

You could use WebDeploy - it will do everything for you quicker than you can do it by hand. It will still stop the application then swap the files out and then start the application again but in most cases when I've done this nobody has ever noticed (admittedly not a busy service)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top