views:

1708

answers:

8

Have you used Sinatra successfully? What kind of a project was it? In what situations would you recommend using Sinatra instead of Rails or Merb?

+2  A: 

There is a list at http://www.sinatrarb.com/wild.html.

Still, I'd like to hear a bit more about them. I also suspect that there are lots of successful Sinatra projects outside that list.

Antti Tarvainen
+8  A: 

I've dabbled with Sinatra, but haven't really written anything serious with it. As you said above, there's a list at http://www.sinatrarb.com/wild.html, although a lot of the applications listed there seem to link to GitHub pages, which I assume are often people experimenting with Sinatra and publishing their results online. Then, there's also the Sinatra mailing list, where you might find links to some interesting projects.[*]

As for your question on when to use Sinatra, I personally would answer "for smaller projects." When you want something up and running very quickly, it seems like Sinatra is an excellent choice. It's also great for people who like Ruby. With that I mean, when you're doing something in Rails, you have to do it "The Rails Way". Rails is the framework upon which you're building your application, and you have to adhere to its customs and conventions. Sinatra, on the other hand, feels like a library. You feel like you're writing Ruby, if you want to connect to a database, you use the library you like/think is appropriate for the job, if you want to output HTML you choose the templating library you like, and if you want a simple web framework, you choose Sinatra. Sinatra is not something upon which you build your whole application, it's something you use beside the rest of your application.

So, as you may have gathered, I'm quite fond of Sinatra, and I would use it for personal (or small-scale) projects. It's easy to set up and easy to use, as long as you know what you're doing. Looking through http://www.sinatrarb.com/wild.html, it seems like that's what most people are using it for, see for example Is Lost on yet? and Calendar About Nothing.

[*] Edit: I found a thread here, with people linking to their projects. There seem both larger and smaller projects. Very interesting stuff.

JW.
+1  A: 

I just released TweepDiff (http://tweepdiff.com) written in Sinatra. Anything else would have been overkill but I would use Sinatra for bigger projects too.

Brian Deterling
That's a nice app. Did you use a library for twitter access?
aaandre
+2  A: 

I think sinatra is best suited for micro-applications development (no big surprise, it's a micro-framework)

Sinatra provides you with a sufficient level of abstraction to build almost everything you want quickly. And what I like about sinatra is that the framework gives you tight control over what your app is actually doing, you can really "feel" what you are writing. So, I would say Sinatra is a subtly balanced framework.

I also think Sinatra is attractive for "people who likes writing Ruby" as said before. You start writing ruby class before implementing a sinatra interface. (good exemple of this kind of workflow here : http://dev-logger.blogspot.com/2009/01/ric-rac-roe-in-soup-of-technologies.html)

Gaetan Dubar
A: 

I'd have to echo most of the above comments. We're in the process of implementing a Sinatra/HAML stack for browsing and basic reporting on data.

I really like the combination of simplicity and direct connection to Ruby. If something isn't working in the browser, it's pretty easy to port it out to a straight Ruby program for debugging.

There's definitely a feeling of building a dog house with Sinatra versus the Taj Mahal with Rails. It's easy to comprehend (it's also helping me understand the need for MVC and Rails).

Altogether very cool stuff and very fast. I haven't stressed it yet, so I can't say how well it'll behave in the real world.

Nick
A: 

I wanted to be able to run succinct self-contained Ruby scripts from my web server. As far as functionality goes, it would be similar to a CGI library. Sinatra was perfect. One sinatra app later and I have a collection of scripts accessed through simple sinatra style routes.

Whenever I need to write a web application that doesn't depend on a database, I suspect sinatra will be my first port of call.

deau
Oh, the question that got me onto sinatra was here;http://stackoverflow.com/questions/987731/posting-an-html-form-to-remote-cgi-written-in-ruby
deau
A: 

I made http://istay.com using sinatra, all I can say is that it is a fantastic little framework for any site that doesn't directly use or doesn't have a database.

Though I do feel sinatra has reach it's limit with the current site, and any extensions will be written using Rails or other framework.

Matt
A: 

I use Sinatra for small 'one function' kinds of apps (My current blogging engine might be a good example). I think the simplicity of Sinatra works best for little utilities and basic API front-ends (Twitter apps, etc).

For larger scale apps there is even the Sinatra-based Padrino Framework with some of the niceties that you would usually reach for Rails to provide.

Nathan