wiki:eXQuery
Last modified 12 years ago Last modified on 01/10/07 14:14:28

Distributed XQuery

Much of the current discussion in distributed XQuery falls into 2 main camps. The enterprise group focuses on ease of use with substantial configuration (bea fluid), their solutions tend to target seamless querying of multiple source using custom XQuery engines. The other group is mostly academic (baels et al) and suggests a decentralized solution that moves the work from system administrators to the query writers. The primary advantage to the industry approach is that distributed sources are treated as regular documents and queries are transparently shipped. The main advantage to the academic approach is that it can be accomplished with modest extensions to existing XQuery engines, but this comes at the cost of explicitly shipping queries. I suggest a third approach to combine the advantages of both approaches. By employing a smart preprocessor we can provide an almost transparent approach that only requires modest extensions to existing engines and reduces the configuration burden.

for $x in doc(”xqueryService”)/ab
for $y in doc(”xmlDoc.xml”)/cd[ab=cd]
return 
$y
let $result : = execute at “xqueryService” xquery
{
<result>
{
	for $x in $root/ab
	return $x
}
</result>
}
for $x in $result/result/ab
for $y in doc(”xmlDoc.xml”)/cd[ab=cd]
return 
$y
for $x in dxq:docService(”xqueryService”)/ab
for $y in doc(”xmlDoc.xml”)/cd[ab=cd]
return 
$y

We can see that with the approach proposed by Baels et al, a relatively simple query over two sources becomes quite complex when compared to the approach employed by BEA. The middle road requires the query writer to know that a document is provided as a service, but can be converted into a shipped query by analyzing what data is needed from the remote service and reformulating the implicitly distributed query into an explicitly shipped query.