Fog Creek Software
Discussion Board




Upgrade without stopping

I understand it is very common in telecom to find requirements where you must upgrade a function on the fly without stopping the systems. For example, changing the reporting feature of a billing system without shutting the billing system down. Can you do this for network servers or service daemons written in languages like Perl, Java or C#? Any helper libraries?

Li-fan Chen
Tuesday, July 20, 2004

Coplien's _Advanced C++_ has a section on dynamic loading: including how to "cut over" instances of an existing class so that they become instances of a newly-loaded class.

There may be an easier way to do it when the system is networked, for example:

1) Have a sysem sending messages to an old billing service
2) Bring up the new billing service while the old billing service is still running
3) Begin to send messages to the new billing service

You needn't cutover all at once, because a billing service might need to pair the messages from the begining and end of each call: so you might cut it over such that messages for new calls are sent to the new service, and the call-ended messages from already-established calls are sent to the old service (which may be shut down when the already-established calls are finished).

A wealth of techniques. Perhaps it would help if you were more specific about what you're trying to do, and what the difficulty is in doing that.

Christopher Wells
Tuesday, July 20, 2004

It's suppose to be second nature to do live upgrades in erlang, unfortunately it's not what some would call a "mainstream language".

Li-fan Chen
Tuesday, July 20, 2004

ASP.NET does exactly that.

Steve Jones (UK)
Tuesday, July 20, 2004

Steve Jones (UK), ASP.NET only does that because web services are "connection-less" if not "session-less". I am talking about services that can't interrupt their sessions/connections. For example: video stream filters, a watch-dog monitor, etc etc.

Li-fan Chen
Tuesday, July 20, 2004

"ASP.NET does exactly that."

But then Windows will require a reboot for the changes to take effect;)

.net, the equivalent of MS Bob.
Tuesday, July 20, 2004

It applies to everything else too, not just web services.

For example, a web page.

I believe the next version (ASP.NET 2) will make even more use of this dynamic re-compilation capability and it can be extended to user objects too.

Steve Jones (UK)
Tuesday, July 20, 2004

>> Coplien's _Advanced C++_ has a section on dynamic loading: including how to "cut over" instances of an existing class so that they become instances of a newly-loaded class.

Absolutely, totally, insane. Masochistic, too.

Bored Bystander
Tuesday, July 20, 2004

Doesn't ASP.NET have to stop the worker processes in order to load up the new assemblies?

If you want truly dynamic assembly loading and unloading in .NET, there's only one way to do it:  via an AppDomain.  In .NET, it is (by design?) impossible to unload an individual assembly.  But you can unload an entire AppDomain.

So one solution is to separate the system into components/plugins which can be swapped out at runtime, and then use AppDomains to load and unload them.  Of course, there's probably a big performance hit doing that.

Another solution, as mentioned above, would be to use a message-based system.  You could do this with web services and UDDI.  Basically, the app looks up the service dynamically in the Directory rather than having a hard-coded reference or a URL in a config file somewhere.  Then, when you want to replace a service, you just update its entry in the directory and new requests automatically go to the right place.

Joe
Tuesday, July 20, 2004

Best solution is redundancy. If it's too important to shut down then it's two important not to have two of.

Snotmonster
Wednesday, July 21, 2004

*  Recent Topics

*  Fog Creek Home