Node.js versus Rails

Node.js versus Rails

A quick comparison of Node.js versus Rails.


Serene Careaga

February 19, 2013


  1. NODE.JS VERSUS RAILS Serene Careaga @grrlcoder

  2. GUIDING QUESTIONS:  What is Node.js, and why is it

    in such high demand?  How does it compare to Rails?  When should I consider using Node.js?  Where can I learn more about Node.js? NODE.JS VERSUS RAILS Serene Careaga @grrlcoder
  3. Node.js is a server-side Javascript platform that receives and responds

    to HTTP requests. More detail:  Single-threaded processes;  Event-based execution;  Built on top of Google’s V8 Javascript engine;  Asynchronous I/O library. NODE.JS What is it? Serene Careaga @grrlcoder
  4.  Alternative solution to the resource- intensive multithreading server processes.

     Fast response times/low latency.  Javascript language use bridges front-end and back-end developers.  Lightweight server solution.  Can be paired with Express.js to be a RESTful web development framework. NODE.JS The Pros Serene Careaga @grrlcoder
  5.  Library of modules to extend functionality lacks breadth; young

    product.  Best use-case is quite limited: heavy on I/O, APIs, streaming data.  Requires significant configuration time to get running on a server. Not ready “out of the box.”  Testing frameworks are not robust. NODE.JS The Cons ( why-we-moved-from-nodejs-to-ror) Serene Careaga @grrlcoder
  6. Node.js has strong appeal to businesses and clients, and it’s

    practical experience that hiring personnel are looking for in developers. Case Study: LinkedIn Mobile Product  Much better performance and lower memory overhead than other tested options, running up to 20x faster in some scenarios.  Frontend and backend mobile teams could be combined into a single unit and leverage their JavaScript skills.  Servers were cut to 3 from 30. Enough headroom remains to handle 10x current levels of resource utilization.  Development could focus more on application development than firefighting. NODE.JS Who cares? Serene Careaga @grrlcoder ( -from-rails-to-node-27-servers-cut-and-up-to-2.html)
  7. RAILS The Pros  A powerful framework paired with an

    object-oriented language.  An active community that offers a lot of support, documentation and tools. (See: Railscast, Ruby Toolbox, etc.)  Full ecosystem that allows for seamless vertical integration.  Rapid deployment.  So. Many. Freaking. Gems. Serene Careaga @grrlcoder
  8. RAILS The Cons Serene Careaga @grrlcoder  Database orientation can

    be difficult to maintain.  Scalability concerns (note: ORM/query problems often the cause).  Rails is always evolving. This can be difficult for app maintenance and taxing on developers.  High learning curve: must learn Ruby, Rspec (or prefered TDD), SASS, Coffee Script to get your app functional.
  9. Let’s get to the good stuff: What are the best-use

    cases for Node.js, and when does Rails reign supreme? NODE.JS VERSUS RAILS Serene Careaga @grrlcoder
  10. NODE.JS When To Use It  High I/O: games, API,

    VOIP, real-time anything.  Asynchronous hooks: GitHub service hooks, push notifications.  Project requires lightweight server solution.  Example apps: Mockingbird (wireframes on the fly), (Scrabble-ish game), Serene Careaga @grrlcoder
  11. RAILS When To Use It  Works great for an

    array of web products: membership-based sites, CMSs, complex interactive sites.  You have an urge to test, frequently.  MVC design logic and database usage are critical to application functionality.  All the things! (Joking.) Serene Careaga @grrlcoder
  12. A CAVEAT Best of both worlds! Serene Careaga @grrlcoder You

    can configure Rails to run as a single-process, event-driven architecture with EventMachine. You can also configure Node.js to run Ruby. (Plus, don’t forget Express.js for framework functionality!) e-ruby-mongodb-socketio
  13. QUESTIONS? Resources Great overview article by IBM: The Node

    Beginner Book: Mashable’s Introduction to Node.js: StackOverflow Conversations: -node-js on-rails-completely-in-the-future Serene Careaga @grrlcoder