Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please suggest an ORM/db layer #2

Open
sandys opened this issue May 5, 2016 · 4 comments
Open

please suggest an ORM/db layer #2

sandys opened this issue May 5, 2016 · 4 comments

Comments

@sandys
Copy link

sandys commented May 5, 2016

coming from HN (https://news.ycombinator.com/item?id=11634152 and https://news.ycombinator.com/item?id=11632650)

Could you please include something like aiopg in your setup instructions - not as a requirement, but as a recommendation. Too many of us are using something like Flask with postgres and we would love to try Growler out.

But the world of Python ORMs is problematic when it comes to asyncio compatible libraries. This includes mysql, postgresql and redis - three of the biggest ones which pretty much everyone uses.

As someone else put it on HN - https://news.ycombinator.com/item?id=11629444

One problem with this is that the entire ecosystem has to get on board with async. Maybe a new framework would make it compelling enough, who knows.
This was/is the big issue with Tornado, IMO (and Tornado has been around for ages in framework time). Tornado is only async if the entire call stack all the way down to the http socket is async, using callbacks instead of returning values. This means that any 3rd party client library you use has to be completely written asynchronously, and none are in python. So you end up with a lot tedious work re-implementing http client libraries for Twilio or Stripe or whatever you're using.
I'm curious to see where asyncio goes in python, but I'm a bit skeptical after seeing how much of a pain it was to use Tornado on a large web app. In the meantime I'll be using Gevent + Flask, which isn't perfect since it adds some magic & complexity but has the huge upside of letting you keep using all the libraries you're used to.

@jfmatth
Copy link

jfmatth commented May 5, 2016

Checkout peewee

@sandys
Copy link
Author

sandys commented May 6, 2016

I have checked out peewee, sqlalchemy async, psycopg, psycopg2,
psycopg-cffi and aiopg (loosely based on psycopg).

I mention them, I'm sure there are going to be a lot more suggestions.

I'm looking for one that has been tested and validated as working with
growler.

There always caveats with using databases with async frameworks - and I'm
looking for the developer to.help me out here. For example sqlalchemy async
will only operate in autocommit mode in async,etc.
On May 6, 2016 01:29, "John Flynn Matthew" [email protected] wrote:

Checkout peewee project


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2 (comment)

@foodaemon
Copy link

For growler app talking to mongodb, you can checkout motor (http://motor.readthedocs.io/en/stable/) a db driver that supports non blocking async access. It's not an ORM though.

@Kentoseth
Copy link

Maybe this might help:

https://github.com/aio-libs

There seems to exist support for mysql, postgresql, couchdb, redis, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants