https://kotlinlang.org logo
Title
o

oshai

08/21/2018, 11:59 AM
I am thinking about porting this mysql/postgres async driver to kotlin: https://github.com/mauricio/postgresql-async Is anyone interested using it? want to assist with the task? please ping me directly
💪 1
o

orangy

08/21/2018, 12:52 PM
@e5l
📝 1
d

DALDEI

08/26/2018, 8:59 PM
@oshai re: postgresql-async -- I would be interested but looking at this codebase, my oppinion is that its risky and will take significant effort to maintain. There are a LOT of low-level details in the mysql driver (dont know postgress) -- Even the official jdbc drivers have bugs that take years to address if ever. It would be a hard call to commit to converting to a new driver in any non-trivial project as the risk is high that the expected-unexpected bugs will surface at precisely the worse time.
@oshai re: async driver -- I would like to understand more what the (strong) rationale is to implementing an async driver vs wrapping existing (and stable) sync drivers in threads. Mysql doesnt scale to vast numbers of connections, conversely the 'general wisdom' is to be very conservative on concurrent requests/connections. A good coroutine based thread-disptching interface would be very useful providing it was fully pass-through wrt the jdbc APIs
o

orangy

08/26/2018, 10:03 PM
It’s not about using more connections with the sql server, it’s about not wasting threads while you wait for it to reply.
Then, you have to use connection pooling, and not surprisingly in a sync world HikariCP will block your perfectly async web handler when you need a connection. In an async world it would just suspend a coroutine and let thread handle other requests.
o

oshai

08/26/2018, 11:03 PM
@DALDEI I started with converting, almost done mysql code (not including test docs etc'). you can see it here: https://github.com/jasync-sql/jasync-sql
my motivation is that we are already using this library extensively and it is not supported anymore
so I would like to convert it to kotlin
I hope some of the bugs were already found 🙂 in the Scala version
and I hope people will find the Kotlin version useful at least as they found the Scala version. vert.x uses it for example