5.5 XRPC Extension

XRPC is a simple XQuery extension that allows efficient and interoperable distributed queries. You can use it to

  • query MonetDB/XQuery from any application (or web page) using SOAP requests,
  • pose queries that involve multiple MonetDB/XQuery servers, or
  • pose queries that even involve other XQuery engines such as Galax and Saxon.
The latter option, querying other engines, is made possible by the XRPC Wrapper, a simple HTTP request server that is distributed with MonetDB/XQuery.

XRPC is the result of research of the CWI group in distributed and P2P XQuery evaluation. Background information can be found in this VLDB paper.

WARNING: XRPC still makes use of the old compiler backend and does not use the optimizing algebraic query compiler. Therefore, its query performance can sometimes be inferior to other queries handled by MonetDB/XQuery. Also, as the old compiler backend is gradually phased out, it gets to be less well-maintained and tested in general. Use with caution. We hope to port XRPC to the algebra backend soon.

The XQuery 1.0 language only provides a data shipping model for querying XML documents distributed on the Internet. The built-in function fn:doc() fetches an XML document from a remote peer to the local server, where it subsequently can be queried. The recently published W3C working draft of XQuery Update Facility (XQUF) introduces the built-in function fn:put() for remote storage of an updated document, which again implies data shipping.

To equip XQuery with function shipping style distributed querying abilities, we introduce XRPC. XRPC is a minimal yet powerful XQuery extension that enables efficient distributed querying of heterogeneous XQuery data sources. XRPC enhances the existing concept of XQuery functions with the Remote Procedure Call (RPC) paradigm. By calling out of an XQuery for-loop to multiple destinations, and by calling functions that themselves perform XRPC calls, complex P2P communication patterns can be achieved.

The XRPC extension is orthogonal to all XQuery features, including XQUF. Hence, in all places where a function application is allowed by the XQuery 1.0 language, an XRPC function call can be placed. All functions defined in an XQuery module can be called remotely, provided that both the caller and the callee of the function have access to the same module definition file. All XQUF updating expressions1 can be included in the definition of an updating XQuery module function, which then can be called with XRPC.

The XRPC extension is enabled by default in MonetDB/XQuery. It is compiled together with the pathfinder module. XRPC has two major components, a request handler (module xrpc_server) and a message sender (module xrpc_client). Both module are loaded when the module pathfinder is loaded in Mserver.


Footnotes

[1] The transform expression is not supported yet.