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.