Reputation: 24481
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
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
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.
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