Web-development – How is Node.js different from other server-side frameworks

comparisonnode.jsweb-development

I've noticed that Node.js has become very popular, and I've seen several instances of people doing small-scale projects in it.

I've also looked at pros and cons lists to get an idea of what Node.js can do, but I'm still not clear on how it differs from other, more mature server-side tech like PHP, Perl, or Ruby on Rails.

What, specifically, differentiates Node.js from the current alternatives, and why?

Best Answer

There is two important things that make Node.js different to existing server-side frameworks, asynchronous events and the use of JavaScript as a programming language.

Asynchronous Events

While most of the existing server side frameworks use a synchronous architecture, Node.js uses an asynchronous architecture, which JavaScript can handle well. This means that the server reacts to events and sends events (messages) to e.g. the database. This style of programming is very different to a synchronous style, and may be hard to use with other languages. Node.js employs an asynchronous style with asynchronous IO and can scale well.

See also Event Driven Architecture

JavaScript

JavaScript is the programming language that web applications are using on the client. Using the same language on the server-side means that the developer can apply his JavaScript knowledge both on the client and the server, and use the same functions as needed.

I would recommend the presentation Introduction to Node.js with Ryan Dahl where he explains Node.js event-driven architecture in more detail.

Related Topic