Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding an ORM to a Sinatra app; Is there an ideal one with less issues and good performance?

I am looking to add an ORM to my existing Sinatra app. I went through Datamapper, Sequel and ActiveRecord though I haven't tried ActiveRecord yet.

Datamapper seems easy but I am constantly facing a issue discussed in "What ORM to use in one process multiple db connections sinatra application?", but was unable to understand the solution and root cause for it.

Are there any suggestions to choose the appropriate and performance oriented ORM?

like image 873
abhijit Avatar asked Mar 20 '12 14:03

abhijit


1 Answers

Sequel is fast enough but feature less while ActiveRecord has many cool features what lead to some performance problems.

But, in most cases, performance of the ORM shouldn't become a problem with wise usage. Usually you should think about database performance and application design but not about ORM performance.

If you need something easy and straight you should use Sequel, but for big applications with many nesting forms I prefer ActiveRecord.

like image 76
fl00r Avatar answered Sep 28 '22 11:09

fl00r