First-round Attack (Node.js)

Recently we are planning to build a web application to replace our original desktop app. At the beginning, we considered to apply Python.Django and the first sub-project was an online real-time chatting system. After some quick google search, we got some promising stacks:

Thus, if we stick to Django framework, we have to integrate another framework (Gevent, etc) which will make the whole project complicated and make our following development diffficult.

Finally we decided to switch to Node.js. The most important reason is Node.js is easy for network programming, especially for the real-time project compared with Django.

However, since we are both new to Node.js, we have to start and learn from scratch. The good news is we are both quick learner, and my supervisor really helped me a lot.

My first week gave me a big picture and high-level understanding of Node.js related techniques, so I would like to write some articles to record some of my ideas and shallow understanding.

##First-round Attack

The first question is what hell is the official name? NodeJS, Node.js, NodeJs, etc. Based on the Node.js official website , the name should be “Node” or “Node.Js”. Because the term “Node” has too much meanning and applications, people add “.Js” extension to avoid confusion.

Second question is raised by the extension “.Js”. When the first time I touched Node.Js, I thought it was written by javascript or say it was an javascript application. But actually, Node.Js is written by C++ in order to improve its performance. Node.Js is a js runtime environment. Specifically, the following official description include its features:

Node.js® is a platform built on Chrome’s 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.

Although Node.Js is only two years old, some world-wide companies are already applying it into their current projects, like GitHub, LinkedIn and Yammer.

As for the strength and weakness, I’d like to cite the comments from Jim Patterson, the technical dirctor of LinkedIn:

  • Because Node is non-blocking and event-driven, it is very suitable for handling concurrent request. Thus, the performance of the server based on Node is better than those built by other techniques (i.e, Ruby on Rails). Additionaly, the client-side and server-side codes are both written by javascript, which is fabulous.
  • However, Node is relatively new, thus it is still not stable and changing and Node lacks the support from the third-party libraries. Everythings looks like the start of Ruby on Rails.

Reference