Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

219
Views
MarkLogic server-side JavaScript and XQuery

I am just starting using NoSQL MarkLogic DB and trying to choose for me the best query language to learn and use in future. On server side MarkLogic provides the possibility to use JavaScript API or XQuery API.

I want to receive an advice. Which language is better to concentrate on and learn? JavaScript or XQuery?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It doesn't have to be a binary either/or choice. You can use JavaScript AND XQuery (and XSLT) modules.

Which language to use is largely influenced by your own preference, as well as the type of data you are mostly working with. There are pros and cons for either language, but in terms of APIs and functionality there is almost complete parity.

If you are already familiar with JavaScript and proficient, then you may find it easier and more approachable.

XQuery is not as widely known or popular these days, so it is harder to find developers that are already proficient. It may take a while to get familiar with the syntax and understand what a FLWOR and sequences are.

If you have a lot of XML documents, then XQuery and XSLT would be the natural choice. Building and manipulating XML in JavaScript is kind of awful, in my opinion.

Because the JavaScript API sits on top of the V8 engine, and XQuery is native code, there are some performance differences. For instance, making a call to a MarkLogic built-in function from JavaScript is slower than if it were done in an XQuery module.

There are also some limitations for JavaScript modules. For instance, there are memory limits, there is no xdmp:spawn-function() equivalent, and it doesn't have tail call optimization. So, even if your codebase is mostly JavaScript, you may find that there are some circumstances in which an XQuery module might perform better, or be easier to accomplish a particular task.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!