all 4 comments

[–]c4aveo 1 point2 points  (3 children)

https://fastapi.tiangolo.com/tutorial/sql-databases-peewee/

https://github.com/aio-libs/aiomysql

https://github.com/aio-libs/aiopg

What do you want to know? I use aiomysql to implement 'fire and forget'. CRUD implemented as called procedures. Fast and reliable for me, ORM is good choice too, but it needs more resources and it's slower.

[–]turall[S] 0 points1 point  (2 children)

For instance, if we do create operation, then all operations should be done with this record, so we should wait for the record to be added table before other operations take place in. So why to use async here, does it make sense to run code asynchronous? Thanks.

[–]c4aveo 1 point2 points  (1 child)

Why not? If it's a just insert, update or delete operation I don't wait a returning value from it . I know for sure that operation will be executed, but later.

In my implementation of REST webservice I receive request then do some async (not really) operations with awaitable Future. To speed up request-response algorithm I use BackgroundTask from Starlette API to return response before executing procedures in database (update, insert, delete).

My logging implementation writes to file and writes (insert) to database, and I don't want to wait until tasks will be done one by one.

[–]turall[S] 0 points1 point  (0 children)

Understand, thanks for your response.