[thelist] object relational mapping

Daniel Burke dan.p.burke at gmail.com
Thu Jun 11 21:07:52 CDT 2009


I second Mr Moseley's wise words and add...

While ORMs are good, they fall down when you need to write particularly
hairy SQL, or if your database is slow.

Modern scaling practice, for at least very large systems where 10 database
servers is only just enough, dictates that you de-normalise the data into a
few or only just one table, pull the entire table row to the web server and
filter it on the server, to reduce load on the DB server. ORMs will help
with this.

If on the other end of the scale, if you are doing small shop stuff, with
multiple interfaces to the same database, you'll be using lots of views,
stored procs, etc an ORM can get in your way a lot, in some cases making
things downright difficult.

A good 98% of stuff fits into the ORM model really well, for that 2%, try to
keep the direct path to the DB open. There are things you can do in SQL that
do not map to objects efficiently. Like any tech it has it's Achillies heel.

--Dan

"It's your privilege as an artist to inflict the pain of creativity on
yourself." --Programming Perl 3rd Edition, end of first chapter.


On Fri, Jun 12, 2009 at 9:49 AM, Bill Moseley <moseley at hank.org> wrote:

> On Thu, Jun 11, 2009 at 10:34:03AM -0700, Jay Turley wrote:
> >
> > I don't know that it solves all the world's problems, but it certainly
> can
> > help with development speed.
>
> It really does.  One cautionary note, from experience, is that the
> ORMs can sometimes make inefficient use of the database.  It's easy to
> write code that results in many trips to the database when writing the
> SQL by hand might be a single query.
>
> I'm currently in the process of going back over an application and
> reducing the number of hits on the database for each request.
>
>
> --
> Bill Moseley.
> moseley at hank.org
> Sent from my iMutt
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list