Re: [xsl] XSLt in RDBMs engine? (was XML to Database Inserts via XSLT)

Subject: Re: [xsl] XSLt in RDBMs engine? (was XML to Database Inserts via XSLT)
From: Brian Chrisman <incubus@xxxxxxxxxxxxxx>
Date: Wed, 9 Mar 2005 14:47:20 -0800
> Oracle lets you create an "Object-Relational" view on top of a 
> relational database that pretty much does what you describe.  It also 
> allows direct manipulation of the underlying table data with XML.  It 
> looked like a very nice fit for a web application - XML both ways with 
> XSL to convert the results to HTML for presentation.  Unfortunately we 
> discovered that for more than trivial data volumes the approach was just 
> too slow to be practical.  I'll admit that this was not using Oracle 10g 
> so maybe things have improved, but they would have to improve a lot to 
> be superior than the old fashion way of dealing with databases. 
> A large part of the delay in retrieving data from a database is the data 
> transport - queries in typical web applications tend to run pretty 
> quickly in the database itself.  Complex reports are an exception of 
> course; those generally require extra design work on the database side 
> if they are common.  The result of this unfortunate fact is that doing a 
> lot of little queries as part of your application will quickly result in 
> very noticeable delays if they have to go to the physical database each 
> time.  A better solution is to cache a subset of the data locally and 
> query against that.  This cache can most certainly be a DOM that is 
> organized according to your application requirements.  Fetching the data 
> from the database into the DOM is a single operation and many modern 
> databases will provide the data in XML directly.  On the update side you 
> need to keep track of the changes and convert those to actual database 
> updates.  There are a variety of techniques for doing this from having 
> the front end flag the changes to having the model smart enough to 
> recognize them.  We used attributes in the DOM to keep track of the 
> changes and XSL to convert the updated DOM to SQL statements to get the 
> job done.  Its not as conceptually clean as your suggestion but it kept 
> the users from rioting. 

I *think* I understand what you are talking about here...
I was considering the idea of caching data locally... but
then I realized that in order to have access to all the 
data I might actually need, I'd have to cache about the
entire database.. :-)  I could mark out some subsections
to cache, but then I'd have to go back to SQL and break
out of XSLt to get the data I need on a miss.... which
is just as much work code-wise...

Does Oracle have an XSLt engine embedded in the database
engine itself?  When it comes down to it, that's the tool
I'm really looking for... :-)
I know postgres allows you to store/query XML data *within*
a data field in the database... but I'm looking to actually
treat the database itself like an XML document.... and have
the stylesheet evaluate xpath expressions inside the database
engine, thereby avoiding having to copy data out of the
database and then throw 99.9% of it away before the presentation 
I've really done a lot of looking around for this kind of
solution before... posting here is just kind of a last-gasp
attempt on my part.... I'm designing a rewrite of a decent
sized software project, and if something like this exists, 
I want to use it.. :-)

thanks for your input!


> Maybe some future version of EJB will be more XML friendly.
> Barry

Current Thread