tags:

views:

36

answers:

2

I have a situation to choose between parsing XML documents in Oracle PL/SQL and parsing them in Java. The system receives the XML documents on a message queue and so the XML documents are not on the file system, unless I write them to the filesystem after reading from queue. And, the intent of parsing is to insert/update records in a bunch of database tables.

Which one is a better option from a performance stand-point?

+2  A: 

I'd say Java as if you wanted to horizontally scale (ie. add more servers) then the licence costs of Oracle might prevent this.

Adding another App server just to parse XML with Java is cheap by comparison.

Also (flamebait) DBAs are grumpy.

Damo
+1  A: 

It's really a competition between PL/SQL and many possible Java parsers. It's very likely that some of the Java parsers beat PL/SQL on performance.

Some other reasons to go with a Java parser:

  • License costs will be much less.
  • You're not chained to a particular database.
  • Your solution has more deployment options.

However if you need to extract information from the XML and insert it into an Oracle database, the advantage might go to PL/SQL. In this case it might be worthwhile to prototype both approaches and see. Also consider the development time needed for each: if the number of bytes of XML coming into your system is relatively small, just pick the solution that's fastest to implement.

Jim Ferrans
"You're not chained to a particular database." Java or PL/SQL, it's still Oracle now ;)
APC
Heck, even Oracle or MySQL! ;-)
Jim Ferrans