Node.JS vs Ruby on Rails
Updated: May 14
The hottest languages for startups are node.js and ruby. There is a strong fan following for both of these.
It is a complex choice to choose one of these for your startup. Although Node.JS is a language and Ruby on Rails is a language and framework with it, i will compare these two as if you are comparing the entire node.js stack with ruby on rails.
Node.JS is the hottest new thing with startups. It is an event driven, non-blocking approach, which make lighter, scalable network applications. Node.JS can handle large network traffic and work on single threaded with call back. You can read more about the event driven approach here since it’s an entire topic in itself.
Ruby on Rails is the web application framework build on Ruby language. Rails has a vibrant community and large progress era. Rails is the cross platform, cross server framework which makes it dynamic in nature. MVC pattern make it time efficient. Let’s compare the two a bit more in detail now.
First let’s look at who is using node.js and who is using rails from the big and famous startups these days.
Ruby On Rails (ROR) Startups
Now let’s look at the pros and cons of each node.js and ruby on rails (RoR)
Pros of Node.JS
High market demand and very popular in startups at this time.
Same language on client and server side.
Easy to learn with less dependencies
It can handle concurrent request with minimal overhead because of the way it works. Our tests showed that it can handle 2x-3x more connections on the same server as other languages.
Easy to monitor, deploy and support.
Page load is faster across the site. (Our tests showed that websites are usually 2x-3x faster with node. Check out beakun.com, it was recreated by us from scratch with node.js and load time is less than 2 seconds for each page. Previously, it was 12-18 seconds per page).
Cons of Node.JS
Node is not suitable for processor intensive tasks.
Any CPU-intensive code makes it really non-scalable.
Because it’s new and very hot, there are less developers in market for node.js at this time of writing this article.
Pros of Ruby on Rails ( ROR )
User friendly tool for generating web content.
It is flexible and IDE friendly framework.
It will be easily portable to any platform.
Easy functions and manipulations.
It is consistent in structure and methodology.
Rail has vibrant community.
Cons of Ruby on Rails
Best programming skills are required so top notch programmers with high pay are required.
More trickier if making large projects.
Documentation is only for popular frameworks
More computing resources are required.
Can’t bear large number of request on server.
Why Startups are adopting Node.JS
Many startups are adopting Node.js mainly because
It has efficient server load time.
same language for backend and frontend code
fast performance because of the way it works with event model
quick boot time.
It is designed for message passing between applications instead of processing large web pages.
Why Startups Shift from Ruby on Rails
Many projects are now turning their architectures from RoR to other languages like Node.Js or Perl. Reasons for shifting from the monolithic frameworks to new developing languages are
major problem of Rails is Ruby, it has slow server load time as compared to Node.JS.
Documentation and support is only available for the popular frameworks so that the new features are hard to include.
Rails takes significant amount of time during boot process.
It is suitable for most of the front-end code , but when lines of code grows, it doesn’t work efficiently
Very few companies are sponsoring Rails now , that’s why its development is going slow.
Startups that Shifted from Ruby on Rails
Groupon to Node.JS
Scribd to Node.JS
Yammer to Node.JS
Twitter to Scala (J2EE)
Groupon said that Rail was the good choice of building their website as a startup but we cannot rely the huge requests traffic on RoR architecture. Groupon found it difficult to handle large lines of code. They decided to rebuild their architecture to Node. Now Groupon is proud to be a part of Node.JS community
Yammer by Microsoft
Yammer is a leading enterprise social network for businesses to get work done smarter and faster. Yammer was developed by the ex-CEO of PayPal, they build their startup on Ruby on Rails. In 2012 Microsoft acquired Yammer and then Microsoft changed its architecture to Node.JS
Twitter shifted RoR to multi-paradigm architectural language Scala , which is based on J2EE java Servlets. As twitter grew, Ruby On Rails (RoR) did not scale up well on the server side for large number of requests and twitter decided to move from ROR to scala.
Conclusion – Node.JS vs Ruby On Rails