Node.js VS Ruby on Rails When to Use What?

I have to admit it: I think both Node.js and Ruby on Rails are great.  I have been working with Rails for a while now and have a few Rails applications in production. I have been working on a project using Node.js for a few months now and, though the project is just something for me to scratch an itch and play with Node, I do see some benefits to working with Node.

Right of the batt Node is fast. Google’s V8 engine is the well…. engine that drives Node’s event driven magic and it is certainly the Lamborghini of JavaScript engines. To be clear, I like Rails, but in terms of speed Node beats Rails hands down. Again, I am sure that a bad Node code will still be slower than some super optimized Rails code written by a Rails Ninja, but still the point stands.

What Rails lacks in speed it makes up in bling baby! That’s right diamonds may be a girl’s best friend but gems are certainly a Rails developer’s. Currently, there is a huge and incredibly active gem development community that offers their code freely on sites like Node does have NPM (Node Package Manager), but to date there are more gems than Node packages and their seems to be a bit more activity on the gem development side of things; again totally subjective, but there are some hard numbers on Github if you care to do the research; also, it is likely that the Node community will catch up, since the amount of interest and pace of development in the community is simply incredible.

There are a number of other points that could discussed here, but I feel the most important one is that Rails aims to be a full web development framework and Node is more akin to library. If you want a web dev framework that uses Node, consider Express.

Bottom line, I think that Rails is better suited for traditional web applications than Node. I base this mostly on efficiency of developing these sort of applications and the wide assortment of well tested gems that aide in web application development.  Node, however, has a very important place in the modern development landscape: powering backends for rich desktop and mobile applications. Again, Node’s speed and sheer ability to deal with a large number of concurrent connections in a small amount of memory makes this an ideal case for its use.

There you have it. It seems to come down to a trade between power against convenience. Thoughts? Rage filled hate? Find me on Google+ or Twitter. Also, please consider picking up Code Journal. Code Journal is the ideal way to collaborate with other developers using Github on your OS X workstation.

Comments are closed.