Re: Thoughts on SQL vs ORM

Discussion in 'Python' started by Alec Taylor, Feb 6, 2013.

  1. Alec Taylor

    Alec Taylor Guest

    I agree that ORMs can be rather complicated; especially when you need
    to do some refactoring.

    Another reason not to use ORMs is difficult of measuring query complexity.

    However, some of the most major advantages of ORMs are:
    - Generation of forms
    - Same code can be used with multiple backends
    - The different data abstraction can sometimes be useful

    Personally for my projects I don't use an ORM. I use a DAL: Database
    Abstraction Layer, specifically the one from web2py (usable with a
    variety of competing frameworks including Flask).

    This has the advantages of:
    - Generation of forms
    - Same code can be used with multiple backends
    - More concise query construction, using Python language concepts
    - Extremely easy to measure query complexity and amount of data that
    will be manipulated (compare this to Django's ORM; which essentially
    requires use of DDT)

    Just my 2ยข

    On Wed, Feb 6, 2013 at 11:58 PM, Andriy Kornatskyy
    <> wrote:
    >
    > The question of persistence implementation arise often. I found repository pattern very valuable due to separation of concerns, mediate between domain model and data source (mock, file, database, web service, etc).
    >
    > The database data source is somewhat specific since you can proceed with SQL functions or ORM. Here are some thoughts why you might prefer SQL functions over ORM in your next project:
    >
    > http://mindref.blogspot.com/2013/02/sql-vs-orm.html
    >
    > Comments or suggestions are welcome.
    >
    > Thanks.
    >
    > Andriy Kornatskyy
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    Alec Taylor, Feb 6, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom

    modeling--DAO vs ORM

    Tom, Jan 11, 2006, in forum: Java
    Replies:
    1
    Views:
    2,326
    Alan Krueger
    Jan 14, 2006
  2. Robert Brewer

    Dejavu 1.2.6, a Python ORM

    Robert Brewer, Dec 16, 2004, in forum: Python
    Replies:
    0
    Views:
    371
    Robert Brewer
    Dec 16, 2004
  3. falcon
    Replies:
    2
    Views:
    557
    clothingoptional
    Sep 5, 2006
  4. flebber
    Replies:
    3
    Views:
    267
    flebber
    Aug 14, 2009
  5. Andriy Kornatskyy

    Thoughts on SQL vs ORM

    Andriy Kornatskyy, Feb 6, 2013, in forum: Python
    Replies:
    3
    Views:
    136
    Chris Angelico
    Jun 11, 2014
Loading...

Share This Page