Hi, Pony ORM developer here. We just get first public attention today, so I
don't think there are many
experienced Pony ORM users exist at this moment (April 2013) ;-)
I think that currently Pony ORM is suitable for experiments, but probably
not for immediate in-production usage.
Currently Pony ORM is a great toy, and during the next few months we must
implement several tasks in order
to get complete product. For example, we must add support of Psycopg2
PostgreSQL driver (currently we work
with PostgreSQL via PyGreSQL which is not as popular as Psycopg2). This is
not hard, but just takes some time.
Also, we must add migration support (and its implementation will be really
cool, we plan to get migrations
automatically from diagram changes in visual diagram editor).
I expect Pony ORM will be fully production-ready a few months later.
Regarding to benefits of using Pony ORM, I think its mainly in higher level
of abstraction. With Pony, you can
write query to database as if you write simple python generator to iterate
over ordinary python list of objects.
So, you can do something like this
orders = select(o for o in Order if o.date_shipped.year == 2012)
And you get optimized SQL query which return list of order objects. You can
pass this objects between
several layers of you application, and when some of this objects are
updated, Pony ORM accumulates
these updates and then send changes to database on commit() execution.
The main architectural difference between Pony ORM and SQLAlchemy is this:
SQLAlchemy based
on relational data model, and can write queries to relational databases
only, whereas Pony ORM
internally based on "entity-relationship" model which is independent of
SQL. So, in the future, Pony ORM
could be used with NoSQL databases such as MongoDB. But currently only SQL
databases are supported.
So, at the current time the main difference between Pony ORM and SALAlchemy
is that SQLAlchemy
queries are more verbose. For example, this is Pony ORM query:
select(o for o in Order if o.date_shipped.year == 2012)
And this is equivalent SQLAlchemy query (did't test it):
session.query(Order).filter(extract("year", Order.date_shipped) == 2012)
This is really the matter of taste and personal preferences, so no critique
here.
SQLAlchemy is great ORM, but I just forget correct query syntax every time
:)
I hear from many people that they cannot handle SQLAlchemy "complexity",
so maybe Pony ORM will be good choice for them.
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.