Re: pl/Ruby, deprecating plPython and Core - Mailing list pgsql-hackers

From Dave Cramer
Subject Re: pl/Ruby, deprecating plPython and Core
Date
Msg-id 51071547-8189-4C25-8488-BC8F89A1F1ED@fastcrypt.com
Whole thread Raw
In response to Re: pl/Ruby, deprecating plPython and Core  (Christopher Petrilli <petrilli@gmail.com>)
Responses Re: pl/Ruby, deprecating plPython and Core  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
As there are two java procedural languages which are available for  
postgreSQL Josh asked for an explanation as to their differences.
They are quite similar in that both of them run the function in a  
java vm, and  are pre-compiled. Neither attempt to compile the code.

The biggest difference is how they connect to the java VM.

PL/Java uses Java Native Interfaces (JNI) and does a direct call into  
the java VM from the language handler.

PL-J uses a network protocol to connect to a java VM.


There are advantages and disadvantages to both approaches.

+ JNI is simpler, doesn't require a protocol, or an application  
container to manage the User Defined Functions
- JNI requires that the vm runs on the server machine, and a separate  
vm be instantiated for every connection that calls a function.    This is mitigated somewhat in java 1.5, by sharing
data,however  
 
this may or may not be a Sun only feature ( does anyone know );    either way a separate vm is required for each
connection.
- startup time for the vm on the first call for the connection.
- Possible ( not as likely any more ) for the java VM to take the  
server down.

Using a network protocol such as a pl-j does  has the following  
( basically the opposite of the JNI (dis)advantages )

+ The java VM does not have to run on the server.
+ Only one vm per server
-  More complex, requires a micro kernel application server to manage  
the UDF's  currently http://loom.codehaus.org/


Dave





pgsql-hackers by date:

Previous
From: Ali Baba
Date:
Subject: transactions not working properly ?
Next
From: Andrew Dunstan
Date:
Subject: do we need inet_ntop check?