Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

SELECT * FROM everything, or why databases are awesome. I’m beginning to think that for scalable applications the thinner your ORM is the better—if you even use one at all.

Tagged , , , , , ,

6 comments

  1. Yes. I'm pretty tired of miraculous ORM systems.

    Every time I see some "build a blog in 30 seconds" screencast based atop some magic data model in the latest web MVC framework, I want to hop & shout.

    Go away with your 30 second blog and turn it into something popular. Then, come back in 30 months and tell me how that all worked out.

    l.m.orchard - 22nd June 2007 04:43 - #

  2. I currently write my own mappers (as I'm wary of generalised frameworks) based on which is the more appropriate of the Data Mapper or ActiveRecord patterns ... takes longer to code but I have more control over the SQL.
    If you haven't come across it already, you might want to look at iBatis and its various ports.

    Andrew Whitehouse - 22nd June 2007 14:40 - #

  3. This is true, but only for systems where the code review process (or skill level of all the developers) is such that the SQL will be reasonably efficient.

    The number of times I've seen WHERE blah LIKE 'som%thing' instead of REGEXP, or bloody silly JOINS or - here's a good one - people using the WHERE clause for limitations that should be in the JOIN clause...

    ORMs at least offer you that level of abstraction for those that don't know what they're doing with raw SQL. And the good ORMs allow you to bake your own solutions when you need to.

    After that, it's just a matter of the overhead added by an ORM, but that's a perennial problem, not something new.

    Graham Binns - 22nd June 2007 15:08 - #

  4. here's a good one - people using the WHERE clause for limitations that should be in the JOIN clause...

    That's generally an infection caused by using Oracle. For the longest time, it didn't support proper join syntax, and doing "from x, y where x.id = y.x_id" is optimized in exactly the same way as "from x inner join y on x.id = y.x_id" in most other databases.

    Jeremy Dunck - 22nd June 2007 17:06 - #

  5. That's generally an infection caused by using Oracle.

    Ah, the sound of the other shoe.

    Graham Binns - 23rd June 2007 00:32 - #

  6. Dropping or on the other foot?

    I think Oracle's great if you need it, but quite a complicated tax if you don't.

    I also think many Oracle experts have no idea how other DBs work.

    Jeremy Dunck - 23rd June 2007 17:37 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site