Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What were Node.js isolates? And why are they now dead?

Tags:

node.js

In 0.7.0, "Experimenetal isolates support" [sic] was introduced. I never understood this besides some vague idea that they gave threading-like capabilities but without the problems of threads. And maybe were good for solving Node's debugging/error handling story.

But, nobody ever explained what they were, either in that blog, or in the first few Google results. What are isolates? Why were they introduced to Node?


This morning, a bunch of GitHub issues (2662, 2663, 2665, and probably more) were closed with the comment "isolates is dead". What happened? Why did this supposedly good idea, which from what I could tell was the headline feature for 0.7, die?

like image 506
Domenic Avatar asked Feb 03 '12 16:02

Domenic


People also ask

Is node JS losing popularity?

Node. js development has become very popular over the last four years and continues to stand the competition in 2022 making startups worldwide choose it over other available options.

Is node js still relevant 2021?

js dead? The short answer is “NO.” The long answer is, “NO, it's not dead, and it probably will never die.” Node. js is just as relevant to coding in 2021 and beyond, even if the hype around it has stabilized slightly.

Why is NodeJS not scalable?

There's no really a good solution in Node for that. You can spawn multiple processes, but then you will not be able to share data between them. Without data sharing, there's no way to scale CPU efficiently, so better don't try.


2 Answers

Explained here: http://groups.google.com/group/nodejs/msg/6b8b8a487d2ab817

Ben just scooped me before I could get the message sent :)

like image 185
isaacs Avatar answered Sep 28 '22 00:09

isaacs


Just in case the link @isaacs postet ever breaks, here the contents:

The Isolates feature was intended to make it possible to run child_process.fork() in a thread, rather than a full process. The justification was to make it cheaper to spin up new child node instances, as well as allowing for fast message-passing using shared memory in binary addons, while retaining the semantics of node's child_process implementation by keeping them in completely isolated v8 instances.

It was a very informative experiment, but has ultimately turned out to cause too much instability in node's internal functionality to justify continuing with it at this time. It requires a lot of complexity to be added to libuv and node, and isn't likely to yield enough gains to be worth the investment.

We're going to roll back the changes in master that were added to support Isolates, and instead focus on Domains and other things that promise to increase stability and make debugging easier. This change will land in 0.7.3. It's entirely possible that we may decide to use v8 isolates in some future version of node, but they will not be in 0.8.

If you were eagerly looking forward to using this feature, and find yourself shocked or frustrated by this decision, please contact me directly. It's not our intention to leave anyone stuck, and I do understand that this feature was promised for some time. If this causes hardship for you, let's figure out another way to get your use cases handled.

It's never easy to back-pedal, but doing experimental things means sometimes finding out that you were headed in the wrong direction. The sooner we make this change, the easier it will be.

Thanks.

like image 37
Domysee Avatar answered Sep 28 '22 01:09

Domysee