1

As far as I know, async apps with thread pool are used to not create new thread per each connection. When this is solved with go blocks in core.async, where socket IO can be parked as it is possible with operating system and popular http libraries supporting it, other blocks like DB queries need to be handled with creating a new thread. For typical web application 99.9% requests are handled with accessing DB and we end up with n connections = n threads. Am I right and is there any solution?

1 Answer 1

2

Yes, you should not use go blocks for blocking operations like IO. Hopefully we'll have async jdbc soon https://www.slideshare.net/ypoirier/jdbc-next-a-new-asynchronous-api-for-connecting-to-a-database

Also there are https://github.com/alaisi/postgres.async

Sign up to request clarification or add additional context in comments.

1 Comment

Wouldn't there usually be a threadpool that maintains connections to the DB? The hope/design being that each individual DB operation would be fast enough that 10k clients could be multiplexed over say 100 connections (adding of course some latency).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.