Rails vs Sinatra

Rails vs Sinatra (Convention vs Flexibility)


This article available in Spanish.


Choosing a framework is much more than following a philosophy. You have to think about what your objective is: Is it a project? Is it to adopt a framework to have expertise in as a company? Does it have good support? How big is its community? What real needs do I have? Are these needs immediate or long-term? These and other questions are necessary when choosing a framework. And for each set of possible responses there is a possible choice.

Rails and Sinatra are two different frameworks with completely opposite philosophies.

There are some developers who are very specific and enjoy knowing how every aspect works; more of a UNIX philosophy. They like having choices and do not like to be told how to do things: no defined structure, no correct way of implementing, and so on. Also, there are people who do not need that much control and value faster results. They do not want to reinvent the wheel, they do not need to know how things are built at the lowest level. Finally, there are people who do like control, that do like to know how it all works at the low level, but do not have the time and willingness that it takes to learn a new framework in depth. These people tend to be willing to adopt a new way of doing things if it lines up with their philosophy and they see it as a very good approach to achieve what they need. People who think as a team, beyond a particular project and beyond an individual.

Let us now see Sinatra and Rails in detail and the possible answers based on the above aspects.

Sinatra

Philosophy: Framework for those who love simplicity, flexibility, agile; light and effective solutions.

Project Type: In general, small and medium-size projects, or that can be considered this way even when part of a bigger one.

Focus: Lightweight solution to specific problems.

Structure: Flexible, customizable by the developer.

Documentation and Community: Good documentation, but a medium-size community.

Rails

Philosophy: It is complete: a framework that tries to cover a large set of solutions. It is based on convention over configuration and, therefore, reflects a strong opinion of how things should be done.

Project Type: Small and medium size. Pretty quick setup. It presents robustness and covers a broad spectrum of solutions.

Focus: Comprehensive and robust solution.

Structure: Defined and concise.

Documentation and Community: A lot of documentation and a very large community.

To summarize we can say that, in general, everything depends on the cycle in which we find ourselves, if we are a company or a single developer, as well as the type of project concerned.

For a company, Rails is a solution to many problems because it provides interoperability. This which is critical when more than one person works on a project. By adopting Rails we manage to have a proven way forward , and a set of tools perfectly fit for small to medium-sized project that greatly improves productivity.

On the other hand, for an experienced developer with a defined mindset who has a specific project, and is looking for a customized solution, Sinatra is the solution that gives the most flexibility in a very simple and elegant manner.



Article by: Alfredo Levy at Bixlabs, Uruguay