News for hackers. Stuff that matters.
Re:Java Virtual Threads: A Case Study by vbezhenar on Wednesday July 17, 2024 @05:44AM (#40984054)
R2DBC allows to efficiently maintain millions of connections to the database. But what database supports millions of connections? Not postgres for sure, and probably no other conventional database. So using reactive JDBC driver makes little sense, if you're going to use 1000 connections, 1000 threads will do just fine and bring little overhead. Those who use Java, don't care about spending 100 more MB of RAM when their service already eats 60GB.
Re:Java Virtual Threads: A Case Study by merb on Wednesday July 17, 2024 @04:11PM (#40989875)
Reactive drivers were not about 1000 connections, they were about reusing a single connection better, by queuing a little bit more efficient over a single connection. Reactive programming is not about parallelism, it’s about concurrency.
Re:Java Virtual Threads: A Case Study by vbezhenar on Thursday July 18, 2024 @01:36PM (#40997951)
It is not possible to reuse a single connection better, if we're talking about postgres. You must conduct the transaction over a single connection and you cannot mix different transactions simultaneously over a single connection. That's the way postgres wire protocol works. I think that there's some rudimentary async capabilities, but they don't change anything fundamentally.

It might be different for some exotic databases, but I don't see any reason why ordinary JDBC driver couldn't reuse single TCP connection for multiple logical JDBC connections in this case.