Posts

What is database replication in MarkLogic

  Database replication is a process to maintain the data of the current forest into another master MarkLogic database. 

MarkLogic server architecture.

Image
There are two layers that work in the complete Marklogic application.  The first is the  Data layer . Second  Query layer .   In the  Data layer : Marklogic stores data (in any format, XML, JSON, text, binary data, semantics ) at the bottom of the data layer. On bottom data, Marklogic creates universal index and range index also if defined. Marklogic also creates a cache and journal in the data layer. In all of this, there is also a transaction controller in the data layers. On came in the second layer.  This is the query layer where we evaluate the x query programs.

What is the basic difference between xdmp:spawn and xdmp:invoke a function in Marklogic.

 Aha..... Before understanding  xdmp:spawn-function and xdmp:invoke-function in Marklogic, we need to understand synchronous & asynchronous terms. Also, we need to know what is the main server, task server, and Transactions in the Marklogic. So I'm posting here the simple definition of each term that I mentioned here.  Synchronous and Asynchronous Task: Synchronous : In synchronous operations tasks are performed one at a time and you can't move the following task until the current task is finished. Asynchronous : In asynchronous operations, you can move to another task before the previous one finishes. Main Server : Task server: Transactions: Now,  We need to know what  asynchronous  functions &  asynchronous  functions in Marklogic are: Asynchronous Functions: xdmp:spawn : Place the specified module/query on the task queue for evaluation. This function places the specified module in the task queue to be processed. The module will be eva...

What is difference between xdmp:estimate and fn:count?

  Ans: Both functions are used for counting the fragments in Marklogic. The xdmp:estimate is fast because it measures through the index and fn:count function also counts the item but also validates in the index and document. But it is not guaranteed that xdmp:estimate & fn:count give the same result. Sometimes xdmp:estimate can give a false result. So fn:count function works slowly as compared to xdmp:estimate. Let's understand in deep, why fn:count & xdmp:estimate results are not the same.  Step-1: Upload below book catalog XML in Marklogic DB. <? xml version="1.0" encoding="UTF-8" ?> < catalog > < book id =" bk101 " > < author > Ralls, Kim </ author > < title > XML Developer's Guide </ title > < genre > Computer </ genre > < price > 44.95 </ price > < publish_date > 2000-10-01 </ publish_date > < description > An in-depth loo...