XQuery as a general data processing language WAS: [xquery-talk] XQuery and Web 2.0

Jason Hunter jhunter at servlets.com
Fri Apr 25 15:31:37 PDT 2008

Christian Grün wrote:
>>  I think the most important part is to put out there open source XQuery
>> modules that do useful stuff, like an
>>  online store, a CRM app, and/or some fun stuff like some IPhone apps that
>> can be written nicely with XQuery.
> Starting with the example of web applications.. I really miss standard
> modules for web servers (like Apache) to directly support XQuery
> scripts on server side.

Yes, it's very convenient that MarkLogic has the option to run as an 
HTTP server.  It makes writing XQuery modules feel like writing JSP or 
PHP pages, with all the pain and overhead of connecting to a database 
removed because you *live* in the database.  The front XQuery pages are 
like template pages using { $curlies } for substitution and calling on 
back-end XQuery libraries for heavy work.  Using XQuery as a template 
language is especially handy because you can't create malformed html; to 
try is a syntax error.

When app scalability requires it, you can go to a clustered database 
system.  A front layer of servers (still MarkLogic) do language 
execution while a back layer of servers manage the content.  All the 
database access internals are embedded within the language.  We're still 
using one server on MarkMail, but we have customers with hundreds of 
servers so we know we can handle hundreds more user load and content.

With MarkMail we put a Squid caching proxy in front so any time you 
request a page that's been seen recently by someone else we don't have 
to hit the database.  In front of that is an F5 load balancer.  It's an 
architecture that's working pretty well for us.

> the (current) limitations become quite obvious (no
> file access to store site statistics, troublesome handling of binary
> content, ...). This might be partially overcome in future if standard
> libraries are added - and this is probably the only way to convince
> most users that XQuery is not just academic and in fact a
> general-purpose programming language (correct me if I'm wrong..).

We use MarkLogic extensions for these things.  For example, all the 
attachment binaries in MarkMail are held inside the database.  We did 
that because then with private lists the db can handle all visibility 
issues without the XQuery code changing a bit.


More information about the talk mailing list