10

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?

Community
  • 1
  • 1
abhijit
  • 1,958
  • 3
  • 28
  • 39
  • What is your problem with DataMapper exactly? – Jonas Elfström Mar 20 '12 at 15:00
  • Exact Problem: http://groups.google.com/group/datamapper/tree/browse_frm/month/2010-08/d45961670db1ede3?rnum=71&_done=%2Fgroup%2Fdatamapper%2Fbrowse_frm%2Fmonth%2F2010-08%3F – abhijit Mar 20 '12 at 15:05
  • 1
    In my experience, the ORM is not nearly as big a problem for performance as how you define your database and queries. From what I've seen, ActiveRecord, Sequel and Datamapper are all capable of generating good SQL. – the Tin Man Mar 20 '12 at 16:45

1 Answers1

8

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.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
fl00r
  • 82,987
  • 33
  • 217
  • 237
  • Hi, thanks for the answer...for looking sequel am referring this--https://github.com/rtomayko/sinatra-sequel, can you suggest me a blog or site which demonstrate use of sequel well. Thanks. – abhijit Mar 20 '12 at 14:47
  • 2
    "Sequel is fast enough but feature less"? I'm not sure what you mean. Does it have fewer features? I find it very useful as it is. – the Tin Man Mar 20 '12 at 16:44
  • 1
    I mean that Sequel has less features than AR. AR is really fat. – fl00r Mar 20 '12 at 16:51