mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

Transaction, PG Connection and Async IO #218

Open corporatepiyush opened 7 years ago

corporatepiyush commented 7 years ago

Does transaction requires a given Postgres connection to be reserved exclusively until commit command or it can be used in another transaction ?

Assuming that someone is using this driver for web application for which all HTTP requests needs transaction, if Postgres connection need to reserved exclusively, then there would be 1 Postgres connection per HTTP request. I wonder How much benefit one might achieve by using this async (non-blocking) driver instead of sync (blocking) jdbc driver ?

domdorn commented 7 years ago

If your full request is running in a transaction, than you need as many connections as you want to serve requests concurrently. You still have the benefits of non-blocking, although your application will only be as responsive as your database backend can be.

corporatepiyush commented 7 years ago

Cool thanks. Are there any real world benchmark results compared to JDBC driver which I can look at ?