You are here:
node.js - built on chrome's javascript V8 engine node.js - built on chrome's javascript V8 engine

Node.js is a platform built on Chrome's JavaScript runtime

Node.js is a platform built on Chrome's V8 JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

So what does node.js do in plain English?

Node.js is not just another JavaScript framework, it's changing the way we think about JavaScript and how we develop online applications for both the web browser and mobiles. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Essentially JavaScript has evolved and can now run on your server, as your web server! No more IIS, no more Apache configs, just a JavaScript engine, running a web server using JavaScript.

So who is using Node.js and why should we take note?

Node is currently being used by some of the biggest brands in the world for various web based API's, websites and online applications. Companies such as Microsoft, eBay, Cloud9 IDE, Uber and localresponse to name just a few. Node allows you to get back down to basics and develop web based systems from a low level.

What about performance and redundancy? Surely Node cannot compete with the likes of Apache?

Node will show much better memory efficiency under high-loads than systems which allocate 2mb thread stacks for each connection. Furthermore, users of Node are free from worries of dead-locking the process—there are no locks. Almost no function in Node directly performs I/O, so the process never blocks. Because nothing blocks, less-than-expert programmers are able to develop fast systems. Node is similar in design to and influenced by systems like Ruby's Event Machine or Python's Twisted. Node takes the event model a bit further—it presents the event loop as a language construct instead of as a library. In other systems there is always a blocking call to start the event-loop. In Node there is no such start-the-event-loop call. Node simply enters the event loop after executing the input script. Node exits the event loop when there are no more callbacks to perform. This behavior is like browser javascript—the event loop is hidden from the user.

HTTP is a first class protocol in Node. Node's HTTP library has grown out of the author's experiences developing and working with web servers. For example, streaming data through most web frameworks is impossible. Node attempts to correct these problems in its HTTP parser and API. Coupled with Node's purely evented infrastructure, it makes a good foundation for web libraries or frameworks.

So what about multi processor servers .. How can node use these if it's not threaded?

Node is truly scalable on a machine level. You can start new processes via

child_process.fork()

these other processes will be scheduled in parallel. For load balancing incoming connections across multiple processes use the cluster module.

n-smith consultancy have experience in designing and developing node based applications and systems. Feel free to contact us for more information or to discuss your application / online system requirements in more detail.