Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Java vs PLSQL

Re: Java vs PLSQL

From: Ted Knijff <knijff_at_bigfoot.com>
Date: Mon, 18 Jun 2001 17:48:50 GMT
Message-ID: <3b2e385b.26110504@news.online.de>

If I may add my bit of stuff. We have some experience with :

- Java Servlets / JSP
- PHP3 and PHP4 (zend)
- PL/SQL

You are best off segmenting the job into : - the Web server
- the Data server
In this way you can quickly and easily separate the application into chunks that you can spread over multiple boxes or networks, as it becomes difficult to find out where the bottleneck is if you don't.

Now in my opinion, PL/SQL (maybe because I know it better) gets the job of getting large amounts of data from the data server to the web server a lot faster than Java, even if both reside on the same box. We have a few admittedly unoptimized systems where PL/SQL beats Java by at least 2 to 1 on a heavily loaded system (don't ask me why, Java seemingly slows down more under heavy load than PL/SQL).

For servlets Java is great, but PHP4 is a great deal faster (about 3 times is our experience with zend) and far more stable and easy to handle. You just don't have the gigantic overhead of the JVM and the crashes you get from code written for a different JRE / JDK environment. Testing and publishing is a piece of cake with PHP compared to Java.

We write triggers, procedures, functions for the database in PL/SQL, store the dynamic stuff in the database and the static stuff directly on the web server, replicating the static stuff with simple PHP scripts. Our content management runs in the database.

This is all on run of the mill hardware, I would not want to say what it is like on bigger systems as we don't have experience with these.

Hth.

Ted

On Sat, 16 Jun 2001 22:48:38 GMT, John Russell <johnrussell10_at_home.com> wrote:

>On Sat, 16 Jun 2001 20:54:15 +0200, Joachim Pense
><joachim.pense_at_t-online.de> wrote:
>
>>Alexander Chupin wrote:
>>
>>> Somebody told me that since Oracle 9i has been
>>> introduced there is a recommendation from Oracle
>>> do not use PLSQL for HTML pages generation anymore. Instead it we should
>>> use Java or JSP. I want to hear opinion of people, which
>>> have experience or made some performance test.
>>
>>In my opinion, writing any code that does string processing (e.g. web
>>page generation or dynamic SQL) in PL/SQL is painful. I tried that
>>once or twice and quickly went back to Perl.
>>
>>Joachim
>
>I believe there is better/faster Java and JSP in 9i. Of course there
>is also better/faster PL/SQL. :-)
>
>Regarding Perl vs, PL/SQL... In my experience, PL/SQL programs follow
>the same general structure for database processing as Perl programs do
>for text processing. So I find it very easy to switch between the two
>and reuse techniques. In Perl, it's
>
>open file
>read entire contents into array
>for each line { search/replace; conditionally print line to screen or
>output file }
>
>With PL/SQL, it's
>
>open cursor (I usually use implicit cursors with FOR loops)
>for each result row { concatenate literals, columns, and function
>results ; print line to web page }
>
>I don't do a great deal of text processing in PL/SQL, but for web
>pages I haven't found a big need for this. Usually concatenation and
>basic search/replace with no regexps are all that I require, and
>PL/SQL does those fine. PL/SQL is gaining Internet-oriented packages
>for things like encoding URLs and CGI-style name-value pairs.
>
>With PL/SQL server pages (new in 8.1.6), you don't have to HTP.PRINT
>each line or bother with || and doubled-up quotes. You can code the
>file like a regular HTML page and toss in declarations, function
>return values, and control structures wherever needed enclosed in <%
>%>. This gets compiled to a stored procedure that does all the
>HTP.PRINT calls behind the scenes. A regular stored procedure can call
>a PSP (e.g. to include a common banner or sidebar on every page) and
>vice versa (e.g. to have a nice-looking page that includes a big
>database-generated block in the middle).
>
>PL/SQL-generated web pages buffer all the output until the stored
>procedure is finished, then send everything to the browser. This is
>the only performance gotcha I've encountered. If you have some static
>content followed by the output of a long-running query, or construct a
>page using the output of several queries, the browser doesn't display
>a partial page while waiting for a query to finish.
>
>John
>--
>Got an Oracle database question?
>Try the search engine for the database docs at:
>http://tahiti.oracle.com/

EMail: knijff_at_bigfoot.com Received on Mon Jun 18 2001 - 12:48:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US