digitalmars.D.learn - Updating D-based apps without recompiling it
- Ozan (13/13) Mar 23 2016 Hi
- Adam D. Ruppe (8/10) Mar 23 2016 The way I always did it was to simply have old and new running
- Jesse Phillips (10/23) Mar 23 2016 Do you have an example of this being done in any other language?
- Jacob Carlborg (6/7) Mar 23 2016 In Erlang it's possible to hot swap code. I'm not sure how it works
- Jesse Phillips (5/12) Mar 24 2016 Looks like it is doable because it is byte code:
- Ozan (12/42) Mar 26 2016 I'm working in SAP area. The main application servers are based
- Chris Wright (8/10) Mar 23 2016 The industry standard is to build on a build server and stop the
Hi Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling. It's not possible to stop an enterprise application, then run "dub --reforce" and wait until finish. Mostly only few functions need to be replaced. Has someone experience with handling upgrading/updating D-Apps on the fly? Working with dynamic libraries or distributed components is not secure enough, but maybe there are solutions, maybe around base calls and functions or completely different. Regards, Ozan
Mar 23 2016
On Wednesday, 23 March 2016 at 12:21:33 UTC, Ozan wrote:Has someone experience with handling upgrading/updating D-Apps on the fly?The way I always did it was to simply have old and new running side-by-side in the transition. So, without stopping the old version, compile the new one and start it. Tell the web server to start using the new one for all new connections without breaking any existing connections. Then when all existing connections are finished, you can stop the old one and remove it.
Mar 23 2016
On Wednesday, 23 March 2016 at 12:21:33 UTC, Ozan wrote:Hi Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling. It's not possible to stop an enterprise application, then run "dub --reforce" and wait until finish. Mostly only few functions need to be replaced. Has someone experience with handling upgrading/updating D-Apps on the fly? Working with dynamic libraries or distributed components is not secure enough, but maybe there are solutions, maybe around base calls and functions or completely different. Regards, OzanDo you have an example of this being done in any other language? Essentially whatever code is being replaced, you're going to need to recompile it. If you're not using dynamic/shared libraries Adam is pointing you in the right direction. If it is a desktop application then it is probably easiest if it communicates to a local service that provides the "replaceable" functions, when you stand up the new service the app can transfer the communication to it. I can't speak to your security concerns.
Mar 23 2016
On 2016-03-23 18:15, Jesse Phillips wrote:Do you have an example of this being done in any other language?In Erlang it's possible to hot swap code. I'm not sure how it works though. But if we're talking servers, the easiest is to have multiple instances and restart one at the time with the new code. -- /Jacob Carlborg
Mar 23 2016
On Wednesday, 23 March 2016 at 17:29:50 UTC, Jacob Carlborg wrote:On 2016-03-23 18:15, Jesse Phillips wrote:Looks like it is doable because it is byte code: http://erlang.org/doc/reference_manual/code_loading.html#id88478 My recommendation would have been using a DLL, but that was already excluded as an option.Do you have an example of this being done in any other language?In Erlang it's possible to hot swap code. I'm not sure how it works though. But if we're talking servers, the easiest is to have multiple instances and restart one at the time with the new code.
Mar 24 2016
On Thursday, 24 March 2016 at 18:46:43 UTC, Jesse Phillips wrote:On Wednesday, 23 March 2016 at 17:29:50 UTC, Jacob Carlborg wrote:It can be done in compiled languages too, here an example of a library that allows it in C http://kitsune-dsu.com/On 2016-03-23 18:15, Jesse Phillips wrote:Looks like it is doable because it is byte code: http://erlang.org/doc/reference_manual/code_loading.html#id88478 My recommendation would have been using a DLL, but that was already excluded as an option.Do you have an example of this being done in any other language?In Erlang it's possible to hot swap code. I'm not sure how it works though. But if we're talking servers, the easiest is to have multiple instances and restart one at the time with the new code.
Mar 24 2016
On Thursday, 24 March 2016 at 23:03:54 UTC, cym13 wrote:On Thursday, 24 March 2016 at 18:46:43 UTC, Jesse Phillips wrote:On Wednesday, 23 March 2016 at 17:29:50 UTC, Jacob Carlborg wrote:On 2016-03-23 18:15, Jesse Phillips wrote:Do you have an example of this being done in any other language?Great link. Thanks for itMy recommendation would have been using a DLL, but that was already excluded as an option.It can be done in compiled languages too, here an example of a library that allows it in C http://kitsune-dsu.com/
Mar 26 2016
On Wednesday, 23 March 2016 at 17:15:35 UTC, Jesse Phillips wrote:On Wednesday, 23 March 2016 at 12:21:33 UTC, Ozan wrote:I'm working in SAP area. The main application servers are based on C++. Every part which is not core could be replaced. Applications running in ABAP are also replaceable (thanks to the JIT) There are also solutions in Java. Application Servers are typical solutions, where code, libs and apps could be replaced without recompiling. Dub is great, but business applications requires more the framework or platform approach. I will try out Martin Nowak's example from DConf. Looks like a solution for me... Regards OzanHi Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling. It's not possible to stop an enterprise application, then run "dub --reforce" and wait until finish. Mostly only few functions need to be replaced. Has someone experience with handling upgrading/updating D-Apps on the fly? Working with dynamic libraries or distributed components is not secure enough, but maybe there are solutions, maybe around base calls and functions or completely different. Regards, OzanDo you have an example of this being done in any other language? Essentially whatever code is being replaced, you're going to need to recompile it. If you're not using dynamic/shared libraries Adam is pointing you in the right direction. If it is a desktop application then it is probably easiest if it communicates to a local service that provides the "replaceable" functions, when you stand up the new service the app can transfer the communication to it. I can't speak to your security concerns.
Mar 26 2016
On Wed, 23 Mar 2016 12:21:33 +0000, Ozan wrote:Enterprise applications in productive environments requires smooth updating mechanisms without recompiling or reinstalling.The industry standard is to build on a build server and stop the application to update, but to have enough redundancy that users don't see any interruption of service. That's how Google and Amazon do it. There are a bare handful of systems that let you avoid that process. In general, it's hard enough for humans to reason about how their application's durable state will handle application updates; adding volatile state into the picture is much harder, and for little gain.
Mar 23 2016