I am writing a simple ruby controller that just needs to respond as a webservice to a bunch of mobile clients.
Someone told me I should look into Sinatra. What is the point of using Sinatra for something this simple? He mentioned that it would be “faster” but how can a wrapper on top of something make it faster?
I don’t want to overcomplicate things; a simple controller is so easy to write and there are less gems to maintain. Am I missing something that Sinatra offers that makes it worth the extra trouble?
Thanks
The simplest useful Ruby web application you could build would be a Rack application. Sinatra is a lightweight DSL which sits on top of Rack to make coding the controllers and views more convenient. You can build more sophisticated applications by including more add-ons like
ActiveRecordorRack::Oauth, etcRails 2 is a more feature rich framework which includes a plethora of additional features already in the framework. Some applications don’t need all that so some developers prefer things like Sinatra which is minimal.
However the distinction between Rails and Sinatra has blurred quite a bit since Rails 3. The new version allows everything from just Rack to full Rails in the stack to you can tailor it to suit your needs. The raison d’etre for some of the intermediate frameworks such as Sinatra is weaker than it used to be.
So take a look at Rails 3, start minimally and grow to suit your needs.