Why use async database connection?

1k Views Asked by At

I just wonder, why would be the case of using async DB connect. From my perspective, it's better to tweak query and schema, maybe re-think your indices at first glance.

  1. In my understanding, db should be executing no more than a couple of ms.

  2. Problem with long connectivity could be solved with connection pulling (constant pinging if there is a tunnel)

  3. If you have async parts of your code, all the code should be async too.

    3.1 Not to forget async is less robust, more error-prone if you have minor experience with it.

    3.2 Async code is longer in a single execution by default, due to the loop nature.

Any really long computation, with the ability to process long networking in business logic - better be done in old fashion - by the separate queue. Since you will lose control of the execution time of your requests anyway. So what is the point anyway?

I could be missing something, but.

As far as I know, Tornado creator (@bdarnell) always saying the same. Correct me please if I'm wrong.

0

There are 0 best solutions below