You definitely don’t want to use Node.js for CPU-intensive operations in fact, using it for heavy computation will annul nearly all of its advantages. And understanding this is absolutely essential. Instead, it’s a platform that fills a particular need. What it really means is that Node.js is not a silver-bullet new platform that will dominate the web development world. The main idea of Node.js: use non-blocking, event-driven I/O to remain lightweight and efficient in the face of data-intensive real-time applications that run across distributed devices. In this Node.js guide, I’ll discuss not only how these advantages are accomplished, but also why you might want to use Node.js-and why not-using some of the classic web application models as examples. The Node.js Foundation has consolidated all the best thinking around why enterprises should consider Node.js in a short presentation that can be found on the Node.js Foundation’s Case Studies page. With all of its advantages, Node.js now plays a critical role in the technology stack of many high-profile companies who depend on its unique benefits. Plus, they were run in isolation and often operated over non-standard ports, which may have required extra permissions and such. One might argue that we’ve had this for years in the form of Flash and Java Applets-but in reality, those were just sandboxed environments using the web as a transport protocol to be delivered to the client. Additionally, it’s all based on the open web stack (HTML, CSS and JS) running over the standard port 80. This is in stark contrast to the typical web response paradigm, where the client always initiates communication. What is so revolutionary about that? Well, after over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections, where both the client and server can initiate communication, allowing them to exchange data freely. In one sentence: Node.js shines in real-time web applications employing push technology over websockets. In Node.js, he gave developers a tool for working in the non-blocking, event-driven I/O paradigm.Īfter over 20 years of stateless-web based on the stateless request-response paradigm, we finally have web applications with real-time, two-way connections. But it’s a key advantage to incorporating Node in your stack.Īs Wikipedia states: “Node.js is a packaged compilation of Google’s V8 JavaScript engine, the libuv platform abstraction layer, and a core library, which is itself primarily written in JavaScript.” Beyond that, it’s worth noting that Ryan Dahl, the creator of Node.js, was aiming to create real-time websites with push capability, “inspired by applications like Gmail”. As this is more a benefit of JavaScript than Node.js specifically, we won’t discuss it much here.
The things that we can do on the web nowadays with JavaScript running on the server, as well as in the browser, were hard to imagine just several years ago, or were encapsulated within sandboxed environments like Flash or Java Applets.īefore digging into Node.js solutions, you might want to read up on the benefits of using JavaScript across the stack which unifies the language and data format (JSON), allowing you to optimally reuse developer resources. JavaScript’s rising popularity has brought with it a lot of changes, and the face of web development today is dramatically different.