What makes Node.js so POPULAR …

What makes Node.js so POPULAR …

Over the last 18 months the use of Node.js has grown at an exponential rate.

It has moved from innovators such as Voxer and Yammer to a group of early adopters that are giving Node.js the credibility required to take it into the mainstream. E-Commerce giants WalMart and PayPal have made big bets on Node while the likes of the world’s most read news publication: – The Mail Online have implemented Node.js and Netflix are now in the process of implementing Node.js too.

So what is really Node.js?

In software development, Node.js is an open-source, cross-platform runtime environment for developing server-side Web applications. Although Node.js is not a JavaScript framework, many of its basic modules are written in JavaScript, and developers can write new modules in JavaScript.

Node.js has an event-driven architecture capable of asynchronous I/O. These design choices aim to optimize throughput and scalability in Web applications with many input/output operations, as well as for real-time Web applications (e.g., real-time communication programs and browser games).

Top 7 reasons to use Node.js

1. Its JavaScript Everywhere

One of the biggest reasons why Node.js is so popular is because it uses JavaScript as its main language to build web applications. And to be honest, JavaScript is now the only choice to develop web applications in the browser. What more! A new and robust framework is introduced quite frequently to woo developers. With Node.js, JavaScript has literally revolutionized on the server. The language is common to most web developers, and is certainly driving the world today. And according to experts, the trend will not fade away soon.

Since JavaScript is a language that most developers know or have used at some point of time, the transition from another web technology to Node.js is a breeze. This makes it a preferred choice among web developers.

2. It's Lightning Fast

Node.js is a JavaScript runtime that uses the V8 engine developed by Google for use in Chrome. V8 compiles and executes JavaScript at lightning speeds mainly due to the fact that V8 compiles JavaScript into native machine code. In addition to lightning fast JavaScript execution, the real magic behind Node.js is the event loop. The event loop is a single thread that performs all I/O operations asynchronously. Traditionally, I/O operations either run synchronously (blocking) or asynchronously by spawning off parallel threads to perform the work. This old approach consumes a lot of memory and is notoriously difficult to program. In contrast, when a Node application needs to perform an I/O operation, it sends an asynchronous task to the event loop, along with a callback function, and then continues to execute the rest of its program. When the async operation completes, the event loop returns to the task to execute its callback.

In other words, reading and writing to network connections, reading/writing to the filesystem, and reading/writing to the database–all very common tasks in web apps–execute very, very fast in Node. Node allows you to build fast, scalable network applications capable of handling a huge number of simultaneous connections with high throughput.

3. It is Lightweight

Typically, Node.js uses a basic event-driven architecture. This means everything executed on it, including every single operation and call, is a series of asynchronous callback. This enables Node to run on a single thread as unlike other web technologies where a new thread is spawned for every client request. This not only makes it light-in-weight, but also forms the foundation of Node’s non-blocking I/O feature.

4. Real-time Made Easy

If Node.js excels at many concurrent connections, then it makes sense that it excels at multi-user, real-time web applications like chat and games. Node's event loop takes care of the multi-user requirement. The real-time power comes thru use of the websocket protocol. Websockets are simply two-way communications channels between the client and server. So the server can push data to the client just as easily as the client can. Websockets run over TCP, avoiding the overhead of HTTP.

5. Streaming Data

Traditionally, web frameworks treat HTTP requests and responses as whole data objects. In fact, they’re actually I/O streams, as you might get if you streamed a file from the filesystem. Since Node.js is very good at handling I/O, we can take advantage and build some cool things. For example, it’s possible to transcode audio or video files while they’re uploading, cutting down on the overall processing time.  

Node can read/write streams to websockets just as well as it can read/write streams to HTTP. For example, we can pipe stdout from a running process on the server to a browser over a websocket, and have the webpage display the output in real-time.

6. One Codebase for All Layers

You may ask yourself, "If Node.js allows me to write JavaScript on the client and server, and makes it easy to send data between the client and server, can I write a web app that runs a single codebase on both client and server, and automatically synchronizes data between the two?" 

The answer to your question would be yes, and the framework for that app would be Meteor. Meteor is a next-generation web framework built atop Node. It runs the same codebase on the both the client and server. This allows you to write client code that saves directly to a database. Then, that data is automatically persisted to the server. It works the other way too! Any data changes on the server are automatically sent to the client. It gets better. Any webpage displaying that data reacts automatically and updates itself!

7. It is Easy to Modify and Maintain

Traditionally built applications become less adaptive and rigid over time as new requirements and new technologies come into play. Eventually, they start creaking under the stress they were not built for. However, developing new services using Node.js is comparatively easier. With Node, a bunch of small applications is built instead of a single, large application. This allows making changes or adding a new functionality with much ease, without having to make changes deep inside the code-base. 

In Conclusion, using Node.js in your application is going to be A Bonus!

Yes, Node.js is trending at the moment. It has huge possibilities that developers can leverage to build highly robust and scalable web applications. So, it is worth a try before it is dead. After all, this is the world of web development!

Amish Kapadiya

Solution Architect at Icertis

8 年

(y)

回复

Excellent read. Thank you Priya Ekbote

回复
Mandar Jambotkar

Intrapreneur, Technology & Products Consultant, Advocate for UX, Innovation & AI Enthusiast, Solution Architect, Software Development

8 年

Nice article Priya Ekbote! Probably, LinkedIn is also using it - which is the best example to gauge it's potential!! (y)

回复

要查看或添加评论,请登录

Priya Ekbote的更多文章

社区洞察

其他会员也浏览了