Gadgets Reviews

Enhance your mind with the latest gadgets, computers, tablets !

NodeJS a Niche Framework – But Still a Good One

Written by Liam Grant. Posted in Computers

Any competent web app developer will have numerous frameworks in his/her toolbox. Among them is NodeJS, a framework written using a combination of JavaScript, C, and C++. Despite its popularity, it is not an all-in-one framework that can be used for virtually any project. You might even call NodeJS a niche framework that supports a very specific function. And it supports that function very well. The primary advantage of NodeJS over other development platforms is its ability to accommodate large numbers of simultaneous connections without any performance drop. If that is what you are looking for in your web app, Node.JS development is something you should be involved in. If you’re looking to build an app that’s going to involve even a small number of operations that are CPU intensive, look elsewhere – Node.JS is not your best friend. [Not a valid template]

Multiple Connections Means More Speed

Web applications have to be designed to accommodate a relatively large number of simultaneous connections if they are to be usable for the general population. Most of the other popular connection techniques utilize frameworks that open a brand-new thread every time a new connection is established. But there is a problem with that: adding new threads with each connection quickly eats up RAM. What do you do when the number of connections exceeds the available memory? You have to do a dump. But that means a lot of dumps for a heavily-used app. NodeJS relies on a single thread that can handle thousands of connections simultaneously using non-blocking I/O calls. The key here is non-blocking. Applications using blocking operations render the framework nearly useless by limiting its ability to accept multiple connections on a single thread. Having said that, let us look at some sample numbers. Let’s assume a web application running on a system with 16 GB of RAM; let us also assume that a single thread is assigned a 2 MB memory capacity. The system could allow for as many as 8,000 simultaneous connections with NodeJS. As long as there are no heavy computations or access blocks in play, it’s easy to see how this single thread with thousands of simultaneous connections is superior to other options.

Two-Way Communication Capabilities

There is another area where Node.JS development excels above and beyond its competitors: the arena of two-way communication. NodeJS uses push technology to communicate over the web, effectively opening up bi-directional communication between client and server. This wasn’t technically possible with legacy solutions. Yes, older technologies did make limited use of two-way communications, but all communications had to be initiated by the client. Now this is no longer an issue. Both client and server can initiate communication from their side, giving us a true bi-directional paradigm. The little bit of sandbox communication we used to enjoy through applets and Flash pales in comparison to what NodeJS can do.

Built-In Package Management Seals the Deal

The Node Package Manager (NPM) that comes with NodeJS seals the deal. While this may not seem all that important, the tool makes package management within the environment incredibly easy. NPM can be used just as easily as any Linux package manager for easy access to modules shared by others. And because the NodeJS ecosystem is completely open, anyone can publish and share new modules or borrow the work of others. NodeJS development will never allow you to build complex applications with heavy CPU requirements, but it is the perfect framework for simple applications that require speed and as many simultaneous connections as possible. Yes, NodeJS is a niche framework of sorts. But it is a good one nonetheless.
Built with HTML5 and CSS3
Copyright © 2012 YOOtheme