ORM Overview

1 view
Skip to first unread message

Terrence Brannon

unread,
Aug 21, 2009, 5:53:28 AM8/21/09
to squatting-framework
Well, I've been playing with some sample databases to get a feel for
various ORMs. It turns out MySQL has a nice collection of databases. I
ended up choosing their Sakila database and modelling the schema
<http://github.com/metaperl/DBIx--Shootout/raw/f03c39b69659e2ad81871155eb3dfadfb55a6c60/lib/Sakila/schema.pdf>

I then began to fool with various ORMs (DBIx::DataModel, DBIx::Skinny,
DBIx::Class, Fey::ORM), but the only one I found intuitive was
Rose::DB::Object.

But, I would like to ease the pain of people surveying various ORMs by
providing all the sample databases, etc for them.

But now that I think about it, maybe it's best that they go through the
same pains I did so they can get an idea of each system from the ground up.

The great things about Rose::DB::Object are:
-- expressive query language. very sql-esque. very easy to switch
between inner and left joins
-- pre-generated accessors for common things like counting
-- 2 classes for each database entity: one for singular actions, another
for multi-row actions. This is the one thing that kept tripping me up on
the other ORMs. I was never sure whether the methods were returning
resultsets or row objects and oftentimes they would do either in a
fashion that I did not find obvious.

draegtun

unread,
Aug 26, 2009, 10:45:10 AM8/26/09
to squatting-framework
On Aug 21, 10:53 am, Terrence Brannon <metap...@gmail.com> wrote:
> Well, I've been playing with some sample databases to get a feel for
> various ORMs. It turns out MySQL has a nice collection of databases. I
> ended up choosing their Sakila database and modelling the schema
> <http://github.com/metaperl/DBIx--Shootout/raw/f03c39b69659e2ad8187115...>
>
> I then began to fool with various ORMs (DBIx::DataModel, DBIx::Skinny,
> DBIx::Class, Fey::ORM), but the only one I found intuitive was
> Rose::DB::Object.

I've stuck with DBIx::Class for some years now and while it does have
a huge learning curve it does reward you at the other end!

From what I can gather if your after compatibility across RDBMS and a
very extensible ORM then DBIx::Class often is best fit. If you needs
require speed then Rose::DB::Object more appropriate.

http://code.google.com/p/rose/wiki/RDBOBenchmarks
http://www.gossamer-threads.com/lists/catalyst/users/3095

Look forward to what your DBIx--Shootout comparison.

/I3az/

Hans Dieter Pearcey

unread,
Aug 26, 2009, 10:53:18 AM8/26/09
to squatting-framework
Excerpts from draegtun's message of Wed Aug 26 07:45:10 -0700 2009:

> If you needs require speed then Rose::DB::Object more appropriate.

I keep hearing this, but I have yet to work on a nontrivial project where the
speed of the ORM's accessors was more important than the speed of the DB it was
accessing, so it always rings a bit false to me.

hdp.

Brock

unread,
Aug 26, 2009, 10:58:49 AM8/26/09
to squatting...@googlegroups.com

Maybe one optimizes joins better or something? Better caching? Hm.

--Brock

Hans Dieter Pearcey

unread,
Aug 26, 2009, 11:06:31 AM8/26/09
to squatting-framework
Excerpts from Brock's message of Wed Aug 26 07:58:49 -0700 2009:

Benchmarks, including the ones linked to earlier in the thread, are usually
things like "insert 10000 rows" -- simple DB operations in what's effectively a
tight loop in Perl. RDBO has lots of inlined code, so it's optimized for that
kind of thing. From where I'm standing, though, it's indistinguishable from
"copy and pasted", and not very appealing.

(Neither RDBO nor DBIC has caching by default, and none of the benchmarks I've
seen have been anywhere near complex enough to test things like SQL join
optimization.)

hdp.

Reply all
Reply to author
Forward
0 new messages