DEV Community

Discussion on: Why should I not choose Ruby on Rails ?

Collapse
 
dakull profile image
Posăceanu Marian

The best way to approach the problem is to write very efficient code from day one

or you could just start with JRuby from day one :-) i.e. have your cake and eat it too

Collapse
 
lpasqualis profile image
Lorenzo Pasqualis • Edited

Yes, starting with JRuby is a good strategy as it allows you to write parts in Java, if you need the speed. You give up compatibility with some gems, but if you start that way it should not be a huge deal. Regardless, it is still slower than other technologies and you have to deal with Rails, which is still heavy (but things are getting better overtime.)

Thread Thread
 
dakull profile image
Posăceanu Marian

you have to deal with Rails

Rails is quite modular [0], [1] - one can easily strip the heavy parts or replace ActiveRecord with Sequel; bonus: with concurrent-ruby [2] things get fast real quick.

[0] - modular Rails controller
[1] - modular Rails
[2] - ruby-concurrency gem

Thread Thread
 
lpasqualis profile image
Lorenzo Pasqualis

It is definitely improving. Version 5 is quite modular. It is a new(ish) thing and it has indeed changed the game quite a bit. Before version 5 it was just mostly a big fat thing :) It has been a slow progress, and I hope they don't screw it up. The unfortunate way they tend to deal with backward compatibility is still somewhat of a concern, but maybe they'll figure it out. If one is willing to always upgrade to every new version religiously, then things get easier. The major problem I have seen is when people stop keeping up.
Threading in Ruby is not real parallelism. Also, most gems out there are not thread-safe, which makes it difficult to work with threads in Ruby.
That said, I am far from being bashing Ruby on Rails. I have been coding in RoR for 10 years, and I like the framework. One just needs to be aware of the tradeoffs and cost at scale. I have been through that pain with versions 2, 3 and 4 and it wasn't fun :) Version 5 promises to do better, but I don't have much experience with it yet.