tags:

views:

215

answers:

2

I've been learning the Ruby web framework Sinatra lately, and I'm finding it great to use. Most of the articles and blogs I have read about it seem to assume that it is good only for small websites, or 'tiny' web-apps. Is this true? Can a complete web application be built in Sinatra, or is Ruby on Rails the way to go?

+7  A: 

You could, in theory, build an entire web application using Sinatra, and it would offer you more precision control than Ruby on Rails would.

That said, it also removes all of the nice features ruby on rails gives you, such as the Model-View-Controller architecture.

If you're looking to build a web application with database interaction, I strongly advise you use Ruby on Rails.

If you're looking to build a very simple API or something that just takes some data and throws it up onto Twitter or something, go ahead and use Sinatra.

Jamie Wong
What exactly about sinatra forces you to lose the MVC architecture? I would argue that you lose doing things the "rails way" but nothing is stopping you from organizing your application in a MVC manner. Furthermore, if you require the ActiveRecord gem in your sinatra application, you have all the database interaction from rails you could ever want. Sinatra allows you to do things _your_ way. I don't think it limits you in any way.
Derek B.
I said it removes the architecture for it, not the capability to use one. I also never said it limits you (in fact I said it offers more precision control). My point was that Rails _provides_ (and somewhat mandates) a solid MVC architecture whereas Sinatra does not.
Jamie Wong
+2  A: 

There is no reason that it couldn't be used to build an enterprise website. It's fast and intuitive. Two key things in building a larger web application. While it does lack many of the features of Rails, I am yet to run into a road block.

I personally like the slim nature of Sinatra. It embraces routing instead of making it a headache.

I usually find myself wrestling with Rails, whereas I configure Sinatra to my liking.

As for database interaction, mongo_mapper + Sinatra works very well.

agentargo