S
S
smartbe2021-02-23 20:57:26
Software Deployment
smartbe, 2021-02-23 20:57:26

How to update dependencies on the server?

Hello! I plan to write my own library and place it on npm.

It will be used on the server. And for example, the server is running, and a new version of the dependency has been released. How to update it on the server without rebooting the entire server? Tell me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vasily Bannikov, 2021-02-23
@vabka

It won't work without a full restart of the app.
Look at the blue-green deployment.

R
rPman, 2021-02-24
@rPman

I'm afraid this is wildly difficult in the general case, in fact the component should be able to do this. And most importantly, it can give rise to a bunch of non-obvious problems.
those. loading a component is just defining a global variable as a method (class) defined in a file (require function). Of course, you can call it again with a new version of the file, but objects (for example, in closures) from the old version may remain in memory. If this is taken into account (each method must check this), then such an update is possible.
Since no one bothers with this, almost all the components used will have to be rewritten.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question