Forum: JRuby [ANN] ruby-pg for JRuby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
John Shahid (Guest)
on 2015-02-26 19:07
(Received via mailing list)
Hi everyone,

Sorry for the double post. I posted this earlier to the announcements
mailing list, but didn't get any feedback. So I'm posting here in the
mailing list hoping to get more audience.

Some of you might have come across the JRuby friendly ruby-pg gem Unfortunately I started this work
than a year ago. I didn't have time to fix the issues that were reported
keep it up to date with the ruby-pg gem. Recently, I got some leisure
and rewrote a big chunk of the gem to make it compatible with 0.17.1.
tested the gem with JRuby 1.7.18 and all the tests pass. The active
(v3.2.21) tests pass as well.

That makes confident to release the gem, may be a release candidate for
now. It looks like the ruby-pg guys are willing to merge the changes in
their repo but it might take a while to do so. I think this gem should
released separately for the now. Unless I get any feedback soon, I'll go
with jruby-pg.


Tim Uckun (Guest)
on 2015-02-26 21:33
(Received via mailing list)
What would be the advantage of this gem vs the JDBC gems?
John Shahid (Guest)
on 2015-02-27 01:01
(Received via mailing list)
good question. there are two advantages that i can think of, first is
asynchronous io and second is that jruby-pg is a drop in replacement for
the ruby-pg gem. also afaik the jdbc interface of postgresql has some
limitations regarding large object api and others that i don't remember
the top of my head. granted this isn't something that everyone needs,
especially new projects, but it was a blocker to switch to jruby for
teams in the past.


Tim Uckun (Guest)
on 2015-02-27 01:15
(Received via mailing list)
Great. Thanks for doing the hard yards!.

Do you have any performance numbers? Will the async IO result in better
John Shahid (Guest)
on 2015-02-28 00:58
(Received via mailing list)
Sorry about the late response. No, I currently don't have benchmark
for the current implementation. I'd love to throw a benchmark tool at it
one already exists for ruby-pg or rails for example. I'm also not sure
the async IO is related to performance. It is a different way of
IO, you can use threads, async IO or some hybrid strategy. Each has it's
own cons/pros regarding resource usage.


This topic is locked and can not be replied to.