This question already has an answer here:
I have been looking at server side Javascript technologies like, Rhino and Node.js. What are the advantages of using server-side Javascript and where in the server-side to they fit in a stack?
This question already has an answer here: I have been looking at server side Javascript technologies like, Rhino and Node.js. What are the advantages of using server-side Javascript and where in the server-side to they fit in a stack? |
|||||||||||
|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
I'll be talking exclusively about Node.js as I don't have any experience with Rhino. The main difference would be the environment they run in. Rhino runs on the JVM and V8 (Node.js) is merely a compiler to native code not an interpreter. The difference between Node.js and Rhino is that Rhino is a JavaScript engine and Node.js is a set of libraries that run on V8 (The JavaScript engine). These libraries are primarily built with an asynchronous approach to provide a fast, scalable system. Async isn't new. Python has many frameworks like Tornado and Ruby has EventMachine. The issue with these is their 3rd party module systems. If you start an using asynchronous you need to only use asynchronous methods. Ruby and Python's 3rd party modules are mostly synchronous. This makes choosing libraries much more difficult and not very appealing. You could say that Node.js is build around the asynchronous model and it's 3rd party model system are purely asynchronous (albeit some exceptions where they specifically state what's synchronous or when they give both asynchronous and synchronous methods). There's lot of library fragmentation in other languages. Fragmentation is async vs sync and module systems. Node.js has arguably one module system: NPM. This creates standardization around 3rd party module. There are many advantages to running Node.js:
As to the questions in the comments (talking about distributed architecture)....
Most of the time you'd want to write these systems independently from Node.js. The purpose of a distributed architecture is:
[1] When you're building high-performance systems you don't need it to be bound to Node.js or the V8 engine as working under v8 and node.js requires additional knowledge and is much much harder to debug as you complicate the layer even more. THe last part might be a tad out-of-scope but I'll leave it in for now. |
|||||||||||||
|