txpostgres
asyncpg
txpostgres | asyncpg | |
---|---|---|
- | 18 | |
103 | 7,128 | |
- | 0.9% | |
2.7 | 7.7 | |
over 1 year ago | about 2 months ago | |
Python | Python | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
txpostgres
We haven't tracked posts mentioning txpostgres yet.
Tracking mentions began in Dec 2020.
asyncpg
-
FastAPI, Pydantic, Psycopg3: the holy trinity for Python web APIs
asyncpg: this was the gold standard async database driver for Postgres, being one of the first to market and most performant. While all other drivers use the C library libpq to interface with Postgres, MagicStack opted to rewrite their own custom implementation and also deviate from Python DBAPI spec. If performance is your main criteria here, then asyncpg is probably the best option.
-
Psycopg 3.2 released – PostgreSQL driver for Python
If you are operating in an environment with asyncio check out asyncpg - https://github.com/MagicStack/asyncpg
Performance charts speak for themselves. This lib uses the binary protocol while most are using text based comms.
- PyPy has been working for me for several years now
-
Ask HN: Is Python async/await some kind of joke?
- SqlAlchemy/asyncpg => you can’t use it if you’re using PgBouncer (necessary most of the time with Postgres) in transaction mode? What?? https://github.com/MagicStack/asyncpg/issues/1058
-
Differences from Psycopg2
OK I stand corrected, asyncpg has these two C files:
https://github.com/MagicStack/asyncpg/blob/master/asyncpg/pr...
https://github.com/MagicStack/asyncpg/blob/master/asyncpg/pr...
If you are interested here is a post by the psycopg author about psycopg2 and 3 and performance versus asyncpg.
https://www.varrazzo.com/blog/2020/05/19/a-trip-into-optimis...
- Asyncpg – A Fast PostgreSQL Database Client Library for Python/Asyncio
-
Ruby Outperforms C: Breaking the Catch-22
This pure Python library claims quite fabulous performance: https://github.com/MagicStack/asyncpg
I believe it because that team have done lots of great stuff but I haven't used it, I just remembered thinking it was interesting the performance was so good. Not sure how related it is to running on the asyncio loop (or which loop they used for benchmarks).
- PgBouncer is useful, important, and fraught with peril
-
Library to connect Python to Postgresql
asyncpg is another great driver if you're using asyncio and want maximum performance (although they also break with DBAPI, but the tradeoff may be worth it).
-
aiopg vs asyncpg vs psycopg3
asyncpg: 5.5k starts, last commit recently, ~150 issues, some incompatibility, few open PRs, extensive README. Includes benchmark showing it's supposedly 3x faster than aiopg and psycopg2, psycopg3 is not mentioned in the benchmark.
What are some alternatives?
psycopg2 - PostgreSQL database adapter for the Python programming language
queries - PostgreSQL database access simplified
psycopg - New generation PostgreSQL database adapter for the Python programming language
Python PG Extras - Python PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
aiopg - aiopg is a library for accessing a PostgreSQL database from the asyncio
django-pgtrigger - Write Postgres triggers for your Django models
pgbouncer - lightweight connection pooler for PostgreSQL
awesome-mysql - A curated list of awesome MySQL software, libraries, tools and resources
pymssql - Official home for the pymssql source code.
apsw - Another Python SQLite wrapper