Via
Bill de hOra I saw this:
this on
ActiveRecord at
Twitter.
Couple 2-3 quotes:
One major downside of having an object-relational mapper is that you don't always control what goes on behind the scenes.
This pretty quickly brought us to an obscure corner of the ActiveRecord source (three cheers for source code!), where it became apparent that Rails was doing these gigantic loads from the database every time we saved even a single field in a related object. There are a bunch of mitigating circumstances that mean that this bug doesn't get triggered all the time, but it's still really really bad.
You mean insane SQL isn't just a problem with Java based OR tools?
I think Ruby is great. I think that ActiveRecord is great and do think that it has it's place.
My problem is that every time I have been associated with an OR tool (Toplink, EJB CMP, Hibernate) the exact panic described above has ensued. In my experience OR tools have been like very bad debt. They are shiny objects that make initial development a bit simpler & then make you pay pay pay down the road.
Now I don't have much information on Twitter, but I'd think that it would be the type of system that you would want to write SQL by hand for. You can either get some syntactic simplicity from OR tools and defer how the SQL gets generated (and wait for panic to ensue) to an OR tool or you can write SQL (a really simple language) and be in control.
Control isn't always required - and I am a big fan of Ruby on Rails - just sayn' choose wisely - there is more to life than concise model to database interaction.
As for the Three cheers for source code line, +1MM. Never ever use an OR tool that is not OSS. That is just asking for it.
I am going to get a breakfast burrito now.