When setting up a new projects plenty developers, who enjoy using all advantages of Ruby ask themselves a pretty tough question: what framework would work best? In the majority of cases the choice lies between Sinatra, Padrino or Ruby on Rails. In this article we will provide you with a list of questions you need to answer first to make the right choice.
Sinatra
Website: http://www.sinatrarb.com
Sinatra is a great framework in case you have a small project. It can’t boast of a great amount of actions Ruby on Rails have, but still works really well for small project. Choose this one if you need no more than 10 actions. Otherwise you might fall in a very common trap: you will have to write by yourself the actions that already exist in the majority of other solutions.
Padrino
Website: http://padrinorb.com/
Padrino offers you great options, when you need to code something creative and have a set of really non-standard tasks. It is really handy for developing some solutions with custom logic. Using Padrino you can make with the minimum of headache and fuss. So if you need to change the standard Ruby on Rails stack significantly, Padrino is the best choice you can make.
Ruby on Rails
Website: http://rubyonrails.org/
There are plenty reasons why Ruby on Rails is so popular.
Ruby on Rails is known for the wide range of libraries it can offer. This makes the development run really quickly. Ruby on Rails works great for medium and big projects. Another case when one should turn to RoR development is when you are developing an MVP and see that Ruby on Rails approach will work well for your case. Ruby on Rails allows creating big, complex and scalable projects within a short period of time like nothing else.
To sum it let’s have a look at the grid.
We hope that using our piece of advice now you will be able to avoid the major mistakes on choosing the right framework.
Questions? Comments? Let’s talk about them in the comments section below.
6 Comments
Just choose Rails. Really. Don’t bother with others. Medior developers you’re certainly going to work with are prepared only for Rails and are not aware of internals of Rails they are going to give up when switching to other engines (i.e. ActiveRecord connection pool management as Rack middleware, anybody?).
Hey Artur, you are totally right! Rails will suit for 95% applications and will be the best choice for them. I wanted to accent in the article that Sinatra and Padrino are designed for very specific cases and warn people before they choose Sinatra/Padrino. I saw too many project crashes because of the wrong choice.
If you are choosing Sinatra to get better performance than Rails, you might want to take a look at this:
https://github.com/luislavena/bench-micro
I would recommend Roda or even straight Rack if you are looking for the highest throughput.
Absolutely right! Also you can find here even deeper experiment with different ruby versions, app servers, frameworks: http://www.madebymarket.com/blog/dev/ruby-web-benchmark-report.html
Of course Rack wins there 🙂
I remembered a benchmark back from 2010, that showed how much object a single “Hello World!” app will create in {Rails 3, Sinatra, Rack} and the result was {8500, 181, 7}. I wonder how these perform now.
http://merbist.com/2010/07/29/object-allocation-why-you-should-care/
Great distinctions, does anyone here know what periscope was built with? How about Uber?