What do you use Sinatra for?

Victor picture Victor · Jan 16, 2010 · Viewed 11.2k times · Source

Im confused about Sinatra (the ruby framework).

Is it a lightweight Rails replacement or you can have them running side by side?

Can you do a web application (as in Rails)? For example a twitter clone?

Answer

hobodave picture hobodave · Jan 16, 2010

Sinatra is not Rails. It is a micro-framework used for simple websites where you may need to just define a few actions. You can make a Sinatra application as complex as you want to, but you'll hit a point where you code has become a crazy mess sooner than with Rails.

While not 100% accurate, Sinatra fits mostly into the Page Controller architectural pattern, and Rails is a clear MVC implementation.

To answer your questions specifically:

  • It is not intended to replace Rails
  • It can run side by side
  • You could create a twitter clone in Sinatra