Is there support for r2dbc-postgresql or jasync-sq...
# exposed
a
Is there support for r2dbc-postgresql or jasync-sq in exposed? is it planned?
d
To my knowledge there is a notion of doing this but no concrete roadmap. It's worth noting that asynchronous IO is not associated with better performance for database workloads the same way it is for HTTP workloads, which is why there is less urgency in the ecosystem for moving to async drivers
a
is not associated with better performance for database workloads the same way it is for HTTP workloads
But it is IO as HTTP, no? The client spends time on waiting for a response, not really the mapping of the resultset.
d
You'll spend that time waiting either way. The main advantage to async is concurrency, but DB workloads optimize throughput and latency at lower concurrency due to the expense of concurrent transaction handling. this is why connection pools advocate lower max connection counts
a
You'll spend that time waiting either way.
No, you can accept in the meantime new incoming HTTP requests, if you are building a web server.
d
You can already do that. You don't need async DB driver in order to use an async webserver
a
But then, you create a platform thread for each new connection to the db
d
BTW, it's worth noting that client side waits for DB connections to become available from the pool can be made async without using an async DB driver. You just need to dispatch to a limited thread pool
That's fine. You'll only need double digit threads for your DB connections
a
you could technically lower them using a async db driver
d
But why would you? The overhead is minuscule
By comparison, HTTP servers need to handle thousands or tens of thousands of concurrent connections. That's why async is so important and standard for HTTP
a
But why would you?
spending time to do web server stuff instead of waiting for a response of the DB ¯\_(ツ)_/¯
d
Your web server isn't blocked by waiting on the DB. If you are using dispatchers correctly, your JDBC operations are not blocking the web server threads
a
So, because the connection to the DB is limited anyway(and Loom availability soon™️), there is no real gain by having async?
d
That's right. You don't have anything to worry about, as long as you are dispatching to Dispatchers.IO or a dedicated DB thread pool Dispatcher
a
Ok, good. Thank you.
101 Views