5.4 HTTP Access

MonetDB/XQuery comes with a built-in HTTP server (see XRPC Extension), that serves out the directory <datadir>/MonetDB/xrpc/. Here datadir> is defined in the MonetDB.conf configuration file (see see MonetDB.conf). This allows you to build a simple website right on top of MonetDB/XQuery.

An important feature of the HTTP server is to serve out all documents in the database. Any document FOOBAR stored in your database, can be accessed on the URL:

http://<machine>:<xrpc_port>/xrpc/doc/FOOBAR

where <machine> should be substituted by the hostname or IP address of the machine where MonetDB/XQuery runs, and <xrpc_port> is the TCP/IP port (see MonetDB.conf).

Inside XQuery queries you can also use the synonym URI:

xrpc://<machine>/doc/FOOBAR

The use of the xrpc:// URI naming scheme tells MonetDB/XQuery that the remote hosts implements XRPC (see XRPC Extension), which may in the future enable distributed query optimizations.