Ruby on Rails vs Node.js

Ruby on Rails or Node.js: what to choose to create a web application?
18 July 2017   2873
Ruby on Rails

Framework, written on Ruby programming language.

Compare Node.js and Ruby on Rails "face to face" will not work. Ruby on Rails is a framework, and what is Node js? This is a software platform that serves as the environment for executing JavaScript code. However, if we consider both solutions as a set of capabilities and tools that they can provide to the developer to create a full-fledged product, then we can draw some analogies. It is in this vein that we will compare these platforms in the article. You can have more info about Ruby on Rails at this article.

Ruby on Rails code example
Ruby on Rails code example

So, let compare Ruby on Rails vs Node.js.

Accessibility for beginners

Node.js can be learned more quickly, because It uses JavaScript. And this language is known for its rather low entry threshold. In addition, frontend developers face JS more often. Therefore, many developers can already have a base to begin learning the basics of Node.

A programmer who has learned Ruby "in passing" on a level sufficient for mastering Rails is a rarity. Usually, if someone writes in this language, he studies it purposefully. Ruby, though it has built-in useful methods for dates, strings, arrays and other elements, can still scare away with more complex syntax.

Performance

The V8 engine running Node.js shows excellent speed results. Ruby is a slow language, and Rails does nothing to increase productivity, inheriting all the problems of the parent. When developing a small application, it is most likely not affected.

Node.jsNode.js

But as soon as there is a certain load on the project, the speed of Node.js will become noticeable. Its non-blocking architecture, built on the use of callback, performs well under concurrency when it is necessary to handle a lot of I / O operations.

Libraries

For more than ten years, Ruby on Rails framework has managed to develop almost all necessary plug-ins and extensions, which not only simplify the work, but also guarantee the absence of problems with their use. For such a long time, all the critical errors and imperfections of the functional have long been found and corrected.

Node.js is actively developing, and therefore not all libraries and additions have taken their final form and often conflict with each other. Yes, they can be easily installed with the help of a convenient NPM package manager, but, unfortunately, he does not insure against errors.
Using JavaScript frameworks like Sails.js or Kraken.js does not help much. Although they are trying to conceptually resemble Rails, they still lack the magic and gems of this framework.

Other features

  • Node.js is an asynchronous platform, which provides an excellent query processing speed. However, this same feature complicates the debugging of JavaScript code. Ruby is a classic multithreaded language, and it lacks this disadvantage.
  • Rails immediately uses MVC and offers a set of necessary functions for development. Pure Node.js does not have these advantages, the use of Express.js even though it makes it possible to use the "model-controller-view" model, still does not allow to achieve RoR flexibility. On the other hand, the way to solve a problem in Ruby on Rails is not always obvious and is hidden behind the abundance of gems and magic. Node.js will show exactly what you wrote, with a minimum of distortion.

Technical documentation and community

JavaScript is one of the most fashionable languages ​​of recent years. Therefore Node.js can be found in very different projects: web applications, messaging systems, CRM-systems, sometimes even on usual sites. Thanks to this, a large circle of developers actively engaged in the development of the language has formed around it. To the platform itself is excellent documentation, but the comments and details of the use of some not very popular libraries may not be enough.

Ruby - this is a fairly long-established community. Rails is the most popular framework for this language, so it's easy to find information on it. In addition, RoR has a detailed technical background, and gems are usually accompanied by detailed developer and community comments.

Final comparison of Ruby on Rails and Node.js

Node.js Ruby on Rails
Development platform Framework
Easy-to learn, based on popular JavaScript  More complicated syntax and the needs to learn from the scratch
High performance Lower performance
Big selection of libraries, but not all of them are equally reliable and compatible Many ready-made add-ons with detailed descriptions and comments
Using an asynchronous programming language Using a multithreaded programming language
Detailed documentartion on Node.js itself, but less detailed about add-ons Formed community and documentation around the framework and add-ons to it.

What technology do you like more?

Node.js and Ruby on Rails are popular programming best on JavaScript and Ruby. Each of them has strong and weak sides. In your opinion, what technology is more perspective and interesting? Maybe, you have a real-work experience with one or both of them? Please, share your opinion!

Ruby Meditation #22 in Dnipro

Meditation will be held on May 19, at Parle, Troitska St, 21 g, Dnipro
27 April 2018   536

On Ruby Meditation #22 you will hear about helpful tools and gems for building Slack apps, examples how to build functional architecture with ruby, which place takes Ruby on Rails among alternatives in 2018 and much more.

Come and get your portion of good mood, knowledge, professional communication and tasty lunch :)

Share your positive experience and best practices on this Ruby Meditation #22. If you have any work issues you cannot solve, our community will gladly help you to find the best way out in live discussion at Lightning talks session. You may also try yourself as a speaker with a short 5-10 mins talk. Fill in this form.

Programme

Anna Shcherbinina

Topic: "Docker + GPU. Not about mining."

Anna Shcherbinina
Anna Shcherbinina

Just before Christmas we launched a new body-measurement feature for our shapify.me project. A person goes into the 3D booth, gets scanned, and the body-measurements are calculated with the 3D scan data. We couldn't avoid using a GPU with these calculations.

How to install this branch of processing into our elegant scaling pipeline? When you're dealing with 3D scans you should remember two things: it's expensive and time-consuming. By the way, its workload fluctuates throughout the days. The easiest solution for us was to use Docker.

This speech is not about mining, but the most helpful articles for us were ones such as "Building your own mining farm". That's because we use quite a similar infrastructure.

GPU, Docker, scaling. What we achieved, where we failed, and what it became of it in the end is all included in my speech.
 

Anna Shcherbinina

Head of Web, Artec3D, Luxembourg

Kirill Shevchenko

Topic: "Building Slack apps with Ruby."

Kirill Shevchenko
Kirill Shevchenko

Overview of Slack APIs. Their features, restrictions, and bottlenecks. Which API is right for you? Helpful tools and gems for building Slack apps.
 

Kirill Shevchenko

Ruby/JS Developer

Valentine Ostakh

Topic: "Functional objects in Ruby: new horizons "

Valentine Ostakh
Valentine Ostakh

Overview of functional programming concepts.  What is functional objects. Examples how to build functional architecture with ruby.
 

Valentine Ostakh

Ruby/JS Developer

Leonid Shevtsov

Topic: "A polyglot's view of Ruby on Rails"

Leonid Shevtsov
Leonid Shevtsov

Nowadays, it's hip to switch from Rails to other languages and frameworks. Leonid, too, has abandoned Rails, played the field a bit, and has come around to occasionally but consistently picking Rails for some projects. What's the modern reason to use Rails? What are the strengths of Ruby and Rails and how to build upon them? When you should really jump to some other platform? Let's answer these questions in a true Ruby meditation.
 

Leonid Shevtsov

Systems Architect

Oleksii Dashkevych

Topic: "Project development - preparing hell dish together"

Oleksii Dashkevych
Oleksii Dashkevych

The recipe is averaged, because of many variations. We take some Ruby code and add Rails magic, Postgresql on top. Add Docker for viscosity. Then put this on AWS EBS pan and start frying. It's all roasted until burning deadlines and generously watered with bugs, serves to the customer. They start eating. Eat and whisper: “This is an awesome product!”. At the same time, he forehead is sweating. Kindly offer to fix bugs, but we refuse and put them in JIRA. Do I need to talk about what kind of feedback comes then? Tasks with such recipes, that double estimated.
 

Oleksii Dashkevych

Ruby/JS Developer

Thanks to the sponsors: Ruby Garage, Railsware, Aejis.

Students, who interested in ruby and have a willingness to visit Ruby Meditation, will get a discount 50% with promocode ‘student’. Please send your student ID’s scan to make your registration on the event faster.

If you are a parent of a small baby (0-3 years) on maternity leave and you want to learn more about ruby development you can get a special discount for a ticket with promo code ‘GrowWithYourKid’. Please send your document's scan or take it with you to approve your status and make your registration in the event faster.

If you have any questions or suggestions, don't hesitate to contact us via cell phone: 099 202 6308 or by email: rubymeditation@gmail.com

More details on website.

Buy a ticket