<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=60438&amp;fmt=gif">

Node.js-web-frameworkEach team is the soul of a company. And each member of the team brings added value to the project they’re involved in, by bringing in their own, personal approach. Bogdan Ursache, one of our Node.js developers, gave us some tips for better working with the Node.js framework. They include

- building RESTful APIs and why Node.js is suitable for this

- a few examples of famous apps that function on the Node.js framework

- why choose it over other frameworks (such as Ruby on Rails)

- how to better learn it

1. Node.js web framework makes building RESTful APIs easier

From Bogdan’s point of view, the choice of working on a Node.js framework is mainly determined by speed and simplicity (it is a lightweight framework). Normally, Representational State Transfer services don’t require the presence of a framework. But if you want to use frameworks, here are some of the best.

Restify

One of the more light-weight frameworks, that don’t force a programmer to use external modules/libraries. Moreover, it functions with a minimum of features. Express, on the other hand, which is the basic Node.js API, contains more functionality (templating and rendering especially): every module needed can be added. Restify is viewed as "a framework that gives absolute control over interactions with HTTP and full observability into the latency and characteristics of my applications."

node js framework restify

Express

As opposed to restify, Express can become overwhelming with time (all end points need to be created manually). A complete list of pros and cons can be found here. Nonetheless, Express.js is definitely the most popular, due to its simplicity and the liberty to reach all the advantages of any other framework. Another one of its advantages is the possibility to find many online tutorials (plus support from the community), in case problems occur. This is why it’s best to stick to the more popular frameworks.

node js framework express

Sails.js 

Mostly appreciated for its flexibility and the speed with which it allows building an app skeleton, this framework can do wonders for Node.js developers. Other features include blueprints, policies, Waterline (ORM). However, disadvantages are also noticeable, since it is new and hasn’t yet been really tested on properly.

Additional Node.js frameworks include Flatiron, Koa, Locomotive.

node js framework sails

2. Famous apps that function on the Node.js framework

If Bogdan’s favorite frameworks for building APIs haven’t already convinced you of what Node.js can do, here’s a list of apps that definitely will. Speed, scalability and maintainability are among the main advantages these companies looked at when deciding to go for it.

- LinkedIn (back-end for their mobile software stack) switched from Ruby on Rails to Node.js

- PayPal

- Walmart

- Microsoft (Windows Azure)

- MySpace

- Yahoo

3. The advantages of using Node.js over Ruby on Rails

One of the main questions Bogdan got when starting to use Node.js was why he felt more attraction towards it than towards - let’s say, the equally popular Ruby on Rails.

Companies such as LinkedIn or Groupon switched to Node.js from Rails because of performance gains and scalability. Software engineers at Groupon claim that the switch was entirely due to the previously monolithic Ruby on Rails applications, that had much trouble scaling.

"Rails still is in use as a RESTful JSON API and for back-end services at Groupon, although plans call for replacing the API with a proxy leveraging Java and Vert.x; the team owning that layer is comfortable with Java" (Sean McCullogh, software engineer at Groupon).

This has caused heated debate among developers. JavaScript programmers can see why such a transition makes sense. In case of transitioning to Node from Rails, there are frameworks that emulate the MVC pattern and that offer support for scalable SOA (service-oriented architecture). Sails.js does a great job of it.

Node.js is only 5 years old (stable version - v0.10.31). Which makes it young and fresh and we know how developers feel when using new programming languages.

General debate assessing the two languages would incline the balance towards Node.js, due to

- its ability to build simple, lightweight web apps

- its speed

- the flexibility in serving as an all-purpose framework (this stands for Express)

- the fizzy and constantly growing community that’s building around it

4. How to better learn it

We wouldn’t be doing our job completely if we didn’t tell you how you can improve your knowledge of Node.js.

Some resources Bogdan recommends include tutorials, blogs and online guides.

- The "Getting started" guide from the Node.js website is a very good point to commence with. The sections on "getting started", "error handling", "using behind proxies" or debugging can set you on the right track.

- the "Express.js Guide: The Comprehensive Book on Express.js", downloadable on Amazon in kindle version

Some useful Node.js blogs include:

Nodeschool.io

A very interesting approach on interactive Node.js lessons, as well as a display of Node.js schools all around the world.

node js web framework

Planetnodejs.com

Another blog tackling Node.js tips&tricks, interesting reads or personal points of views on actually working with it.

node js framework planet node js

Nodeup.com

In the era of social media, podcasts are an option even for Node.js.

node js framework nodeup

Other blogs Bogdan likes include Joyent.com or Nodejs.org (a forum-like blog centered around the community of Node.js developers).

 

WORK AT THINSLICES

Come visit us at the museum!

We are Thinslices, a family of elephants who build technology products and develop mobile apps for startups. You might have seen us on Bored Panda.

Job openings

Articles similar to this one