max_
max_

Reputation: 24481

Is this an appropriate occasion to use ruby on rails?

I want to create a RESTful API for a website which will collect/insert/delete data from a MySQL db. Would Ruby on Rails (RoR) be an appropriate place to do this? I haven't used it before, and this is why I wanted to check to see if this is an appropriate occasion or not.

Upvotes: 2

Views: 115

Answers (2)

Mario Uher
Mario Uher

Reputation: 12397

If your API will have only one or two resources and a few CRUD actions, it will be faster implemented in Sinatra, but if your API will have more than two different resources, I would definitely use Rails, because of its strict MVC model and because you can split your code into different controllers/models and so on.

Sinatra can do the same, but it's more work and Rails does already a lot of work for you. In Rails 3 for example it's one line, and your app will already respond to json or xml.

Upvotes: 0

Nerian
Nerian

Reputation: 16177

Is it just the API?

I would use Sinatra for that. It will give you more flexibility and speed than a RoR app.

http://www.sinatrarb.com/

You can read the book Service-Oriented Design with Ruby and Rails, by Paul Dix. It gives you good overview about this topic.

Upvotes: 1

Related Questions