Rails 3 vs Sinatra

Viewed 10217

For my next web application, I'm debating whether to use Rails 3.x or Sinatra.

I would like to use the server to provide user authentication, application-triggered emails, a fairly complex data model (behind ActiveRecord), and a JSON data interface with the web client. The client side will use static HTML, static CSS, Javascript/jQuery to render the JSON data into the views. The "policy" for rendering views will be driven by the Javascript code and some of the JSON data. I do not plan to use any dynamic view technologies such as ERB, HAML, or RJS.

Would I be better off with Sinatra or Rails 3.x?

Are there any other questions I should ask before making that decision?

5 Answers

Sinatra would be a very good choice and I feel it would be better than rails mainly for one reason. This is linked with what another user wrote "You follow conventions and patterns which ensure your app will be easily maintainable and will scale well.

Some years ago we have developed a fairly large application in rails. All our developers had to do a complete rewrite because the rails core (read 37 signals) do not care to make their new version backward compatible. At every update the code would break.

So coding it in Rails will not ensure maintainability or scalability. Quite the opposite.

In fact scalability will be better on Sinatra as it is more lightweight and you would have anyway to use passenger for deployment. The Sinatra community is no-hype and extremely helpful. There are no prima donnas, big ego to the same degree of Rails. And this does matter because the Rails agenda might differ from yours and you might end up re-writing code very soon. There is a new book on Sinatra by O'Reilly that i think is worth a look as it is full of examples and ideas on what can be done and how.

Related