PostgreSQL port to pure Java?

Started by Ivelin Ivanovover 22 years ago27 messageshackers
Jump to latest
#1Ivelin Ivanov
ivelin@apache.org

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

Ivelin

#2Frank Wiles
frank@wiles.org
In reply to: Ivelin Ivanov (#1)
Re: PostgreSQL port to pure Java?

On Tue, 9 Dec 2003 07:15:41 -0800 (PST)
Ivelin Ivanov <ivelin@apache.org> wrote:

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

This would be a huge undertaking, rewriting PostgreSQL entirely
in Java. Not to mention it would kill PostgreSQL's current
speedy performance!

---------------------------------
Frank Wiles <frank@wiles.org>
http://frank.wiles.org
---------------------------------

#3Doug McNaught
doug@mcnaught.org
In reply to: Ivelin Ivanov (#1)
Re: PostgreSQL port to pure Java?

Ivelin Ivanov <ivelin@apache.org> writes:

Has this subject been discussed before?
I did not find any references to it in the archives.

I think the phrase "not gonna happen" was invented for this subject. :)

-Doug

#4Keith Bottner
kbottner@comcast.net
In reply to: Ivelin Ivanov (#1)
Re: PostgreSQL port to pure Java?

It would be interesting to have a JBoss, PostgreSQL and the JDBC driver for
PostgreSQL all bundled together in a single installation script.

Keith

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Ivelin Ivanov
Sent: Tuesday, December 09, 2003 9:16 AM
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] PostgreSQL port to pure Java?

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

Ivelin

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Frank Wiles (#2)
Re: PostgreSQL port to pure Java?

Frank Wiles wrote:

On Tue, 9 Dec 2003 07:15:41 -0800 (PST)
Ivelin Ivanov <ivelin@apache.org> wrote:

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

This would be a huge undertaking, rewriting PostgreSQL entirely
in Java.

Very true. I just did a rough count and founs about 510,000 lines of
code in .c and .h files in the source distribution.

Not to mention it would kill PostgreSQL's current
speedy performance!

Maybe, maybe not. Modern JVMs have much better performance
characteristics than was once the case. Also, some of the things that
Java buys you (memory management, threading, for example) might actually
enhance performance in some circumstances. A crude port wouldn't work,
though - it would have to be done in such a way as to leverage the
platform's strengths, just as we leverage the strengths of writing in C.

The *big* problem would be keeping a Java port in sync with the base.
That would make it almost impossible to do in a worthwhile way IMNSHO -
the maintenance would be a nightmare.

It would be an excellent student exercise, though :-)

As a Java programmer, I do agree that having a pure Java RDBMS system
would be a Good Thing (tm), and the PostgreSQL code base might be an
excellent place to start creating such a monster :-).

cheers

andrew

#6Neil Conway
neilc@samurai.com
In reply to: Andrew Dunstan (#5)
Re: PostgreSQL port to pure Java?

Andrew Dunstan <andrew@dunslane.net> writes:

Frank Wiles wrote:

Not to mention it would kill PostgreSQL's current speedy
performance!

Maybe, maybe not. Modern JVMs have much better performance
characteristics than was once the case. Also, some of the things
that Java buys you (memory management, threading, for example) might
actually enhance performance in some circumstances.

I'm pretty skeptical that Java's GC could get better performance than
palloc. As for threading, ISTM Java doesn't offer anything we couldn't
get through POSIX threads if we were going to contemplate a full-scale
rewrite anyway (which I think everyone agrees that we aren't).

As a Java programmer, I do agree that having a pure Java RDBMS
system would be a Good Thing (tm)

Are there any advantages that this would provide that we could get
without investing so much effort? For example, PL/Java seems like a
reasonable approach to Java & PG integration that doesn't involve
rewriting hundreds of thousands of lines of code.

-Neil

P.S. While we're contemplating pies-in-the-sky, I'd personally love to
rewrite PostgreSQL in Objective Caml.

#7D'Arcy J.M. Cain
darcy@druid.net
In reply to: Neil Conway (#6)
Re: PostgreSQL port to pure Java?

On December 9, 2003 12:15 pm, Neil Conway wrote:

P.S. While we're contemplating pies-in-the-sky, I'd personally love to
rewrite PostgreSQL in Objective Caml.

I vote for InterCal. :-)

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
#8Andrew Dunstan
andrew@dunslane.net
In reply to: Neil Conway (#6)
Re: PostgreSQL port to pure Java?

Neil Conway wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

As a Java programmer, I do agree that having a pure Java RDBMS
system would be a Good Thing (tm)

Are there any advantages that this would provide that we could get
without investing so much effort? For example, PL/Java seems like a
reasonable approach to Java & PG integration that doesn't involve
rewriting hundreds of thousands of lines of code.

2 different things, ISTM. I don't think the PG group should touch a port
to Java - it would be a huge distraction. If someone (say, Ivelin) wants
to do it, good luck to them. PL/Java would be way cool, though, and have
very significant appeal, and is very much worth doing, I believe. (Not
that I have the time to do it.)

cheers

andrew

#9Andrew Dunstan
andrew@dunslane.net
In reply to: D'Arcy J.M. Cain (#7)
Re: PostgreSQL port to pure Java?

D'Arcy J.M. Cain wrote:

On December 9, 2003 12:15 pm, Neil Conway wrote:

P.S. While we're contemplating pies-in-the-sky, I'd personally love to
rewrite PostgreSQL in Objective Caml.

I vote for InterCal. :-)

Pick your poison from this site: http://99-bottles-of-beer.ls-la.net/
(see especially the entry for "make" :-) )

Personally, I vote for Ada :-)

cheers

andrew

#10Dave Cramer
pg@fastcrypt.com
In reply to: Andrew Dunstan (#9)
Re: PostgreSQL port to pure Java?

Have a look at Axion for a pure java db

http://axion.tigris.org/

Not as full featured,but still useful.

Dave

Show quoted text

On Tue, 2003-12-09 at 13:32, Andrew Dunstan wrote:

D'Arcy J.M. Cain wrote:

On December 9, 2003 12:15 pm, Neil Conway wrote:

P.S. While we're contemplating pies-in-the-sky, I'd personally love to
rewrite PostgreSQL in Objective Caml.

I vote for InterCal. :-)

Pick your poison from this site: http://99-bottles-of-beer.ls-la.net/
(see especially the entry for "make" :-) )

Personally, I vote for Ada :-)

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#11Chris Browne
cbbrowne@acm.org
In reply to: Ivelin Ivanov (#1)
Re: PostgreSQL port to pure Java?

ivelin@apache.org (Ivelin Ivanov) writes:

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

I expect that the general reaction would be along the lines of "Shoot
me now."

Java does not run on many of the platforms that PostgreSQL runs on, so
the pursuit of a rewrite in Java would make PostgreSQL a whole lot
less widely usable.

If you want to take PG and do a rewrite in Java, the license does
permit that. Just don't expect to get a lot of assistance.

Others have suggested OCaml as an alternative; I would suggest
Standard ML to be preferable, since Moscow ML is available on somewhat
more CPU platforms. I _think_ that both OCaml and Moscow ML run on
more platforms than does Java. The strongly self-verifying nature of
ML strikes me as a better idea than Java. Ada would offer similar
benefits, at the cost of quantities of declarations that would make
your eyes bleed.

The more waggish proposal of Intercal is a _bit_ unfair as retort to
ML, though it seems quite apropos for Java :-).

I'll suggest SWI-Prolog, just to be troublesome :-).
--
select 'cbbrowne' || '@' || 'acm.org';
http://www3.sympatico.ca/cbbrowne/spiritual.html
The way to a man's heart is through the left ventricle.

#12Andrew Dunstan
andrew@dunslane.net
In reply to: Dave Cramer (#10)
Re: PostgreSQL port to pure Java?

Dave Cramer wrote:

Have a look at Axion for a pure java db

http://axion.tigris.org/

Not as full featured,but still useful.

Er, I take it that "not as full featured" is an example of meiosis :-)

Here's what the web page says:

----------------------------------------

Not (Yet) Supported Features

*

ALTER TABLE (other than add/drop constraint)

*

client/server mode

*

constraints/foreign keys (partial support is available)

*

GROUP BY/HAVING

*

stored procedures

*

sub-selects

*

triggers (note that default column values are supported)

*

user-level security

----------------------

This is basically a small embedded db engine, not an enterprise class RDBMS.

cheers

andrew

#13Joshua D. Drake
jd@commandprompt.com
In reply to: Ivelin Ivanov (#1)
Re: PostgreSQL port to pure Java?

Hello,

All due respect but this seems like a completely insane idea.

Sincerely,

Joshua Drake

Ivelin Ivanov wrote:

Has this subject been discussed before?
I did not find any references to it in the archives.

I think that a co-bundle between an open source J2EE
container like JBoss and a scalable database like
PostgreSQL will be a blast.

There are several well performing comercial Java dbs
out there and there is Hypersonic which is free and
fast, but supports only READ_UNCOMMITED and is build
to grow up to ~200MB.

Ivelin

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-- 
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
#14Sailesh Krishnamurthy
sailesh@cs.berkeley.edu
In reply to: Neil Conway (#6)
Re: PostgreSQL port to pure Java?

We remain sceptical about writing an RDBMS in Java. The earlier
version of TelegraphCQ was in Java and turned out to be a bit of a
pain.

Some more information:

Mehul A. Shah, Samuel Madden, Michael J. Franklin, Joseph
M. Hellerstein: Java Support for Data-Intensive Systems: Experiences
Building the Telegraph Dataflow System. SIGMOD Record 30(4): 103-114
(2001)

Apart from our group, the database research group in Wisconsin also
rewrote their Niagara system from Java to C++.

--
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh

#15Hannu Krosing
hannu@tm.ee
In reply to: Andrew Dunstan (#12)
Re: PostgreSQL port to pure Java?

Andrew Dunstan kirjutas T, 09.12.2003 kell 22:07:

Dave Cramer wrote:

Have a look at Axion for a pure java db

http://axion.tigris.org/

Not as full featured,but still useful.

Er, I take it that "not as full featured" is an example of meiosis :-)

Here's what the web page says:

...

----------------------

This is basically a small embedded db engine, not an enterprise class RDBMS.

And a small (ok, maybe not small) embedded db engine is the only place I
can see any benefit from a rewrite to java.

The rewrite of early Postgres from LISP to C was probably done for good
reason.

OTOH, it could be cool to be able to run JavaPostgreSQL as a stored
procedure inside Oracle ;)

-------------
Hannu

#16Robert Treat
xzilla@users.sourceforge.net
In reply to: Andrew Dunstan (#8)
Re: PostgreSQL port to pure Java?

On Tue, 2003-12-09 at 12:32, Andrew Dunstan wrote:

PL/Java would be way cool, though, and have
very significant appeal, and is very much worth doing, I believe. (Not
that I have the time to do it.)

http://pljava.sourceforge.net/
Someone did it but it didn't catch fire.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

#17Dave Cramer
pg@fastcrypt.com
In reply to: Andrew Dunstan (#12)
Re: PostgreSQL port to pure Java?

That is the current status, but this is a very active project and I
believe the cvs version is much better.

You are correct though it is an embedded db, and as such is quite cool.

The reason I suggested it was more of an academic exercise for folks who
wanted to see the issues with doing this in java.

Dave

Show quoted text

On Tue, 2003-12-09 at 15:07, Andrew Dunstan wrote:

Dave Cramer wrote:

Have a look at Axion for a pure java db

http://axion.tigris.org/

Not as full featured,but still useful.

Er, I take it that "not as full featured" is an example of meiosis :-)

Here's what the web page says:

----------------------------------------

Not (Yet) Supported Features

*

ALTER TABLE (other than add/drop constraint)

*

client/server mode

*

constraints/foreign keys (partial support is available)

*

GROUP BY/HAVING

*

stored procedures

*

sub-selects

*

triggers (note that default column values are supported)

*

user-level security

----------------------

This is basically a small embedded db engine, not an enterprise class RDBMS.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#18Merlin Moncure
merlin.moncure@rcsonline.com
In reply to: Dave Cramer (#17)
Re: PostgreSQL port to pure Java?

Robert Treat wrote:

Someone did it but it didn't catch fire.

I think what will catch fire in a big way is plphp. Managers will like
an all php platform that is extremely capable and productive.
Developers will enjoy php's natural syntax and agnostic approach to
programming. PHP5, when it becomes production ready, will offer high
level language features that compete with Java, C#, and Object Pascal.

Merlin

#19Shridhar Daithankar
shridhar_daithankar@myrealbox.com
In reply to: Andrew Dunstan (#5)
Re: PostgreSQL port to pure Java?

Andrew Dunstan wrote:

Not to mention it would kill PostgreSQL's current speedy performance!

Maybe, maybe not. Modern JVMs have much better performance
characteristics than was once the case. Also, some of the things that
Java buys you (memory management, threading, for example) might actually
enhance performance in some circumstances. A crude port wouldn't work,
though - it would have to be done in such a way as to leverage the
platform's strengths, just as we leverage the strengths of writing in C.

The *big* problem would be keeping a Java port in sync with the base.
That would make it almost impossible to do in a worthwhile way IMNSHO -
the maintenance would be a nightmare.

It would be an excellent student exercise, though :-)

Jokes and facts aside, I can't help it to think how better it would have been,
if postgresql was in C++. We could easily plug multiple implementations of
underlying subsystems without mucking much in base code..

Wild thought anyways..

Shridhar

#20Doug McNaught
doug@mcnaught.org
In reply to: Shridhar Daithankar (#19)
Re: PostgreSQL port to pure Java?

Shridhar Daithankar <shridhar_daithankar@myrealbox.com> writes:

Jokes and facts aside, I can't help it to think how better it would
have been, if postgresql was in C++. We could easily plug multiple
implementations of underlying subsystems without mucking much in base
code..

That's easy to do in any language if your code is carefully designed
for it (look at the Linux kernel for an example in C) and hard to do
even in C++, if the design isn't suited. So your assertion that C++
would have magically enabled "pluggabilty" doesn't hold water.

Wild thought anyways..

Indeed.

-Doug

#21Thomas Hallgren
thhal@mailblocks.com
In reply to: Ivelin Ivanov (#1)
In reply to: Ivelin Ivanov (#1)
#23Ivelin Ivanov
ivelin@apache.org
In reply to: Jean-Michel POURE (#22)
#24Joshua D. Drake
jd@commandprompt.com
In reply to: Jean-Michel POURE (#22)
#25Andrew Dunstan
andrew@dunslane.net
In reply to: Jean-Michel POURE (#22)
#26Jan Wieck
JanWieck@Yahoo.com
In reply to: Ivelin Ivanov (#23)
#27Thomas Hallgren
thhal@mailblocks.com
In reply to: Ivelin Ivanov (#1)