roed314 / psycodict

Dictionary-based python interface to an SQL database
Other
1 stars 3 forks source link

Upgrade backend library #27

Open roed314 opened 5 days ago

roed314 commented 5 days ago

There are several alternatives to psycopg2 available. Two that look promising are psycopg3 and asyncpg.

We should see how hard each would be to switch to and benchmark them for our use cases.

edgarcosta commented 5 days ago

asyncpg uses async, which makes sense, but will also make it harder for others to use

roed314 commented 5 days ago

I was just curious how much actual speedup we would get from using asyncpg. I doubt we would get the factor of 5 speedup they advertise, but hitting the 30 second gunicorn timeout less frequently would be nice.

roed314 commented 5 days ago

How will it make it harder for others to use?

edgarcosta commented 5 days ago

Learning how to use async properly takes an effort, and I still get confused, but perhaps we do not need to expose this to the final user.

This will enable proper usage of async workers in gunicorn, but for us to take advantage of it we would need to perhaps make certain parts os psycopg async.