HTTP Servers, Database, Forest

     
HTTP Server(Hypertext Transfer Protocol):

An HTTP Server is an application server with HTTP support and XQuery support, providing a server from which you execute XQuery programs via HTTP.

You can create an HTTP server through the Admin UI page of the MarkLogic server. Please refer the screenshot-1 for the same.

Screenshot-1:


Or, You can also create an HTTP server with the help of the admin API function,


(:Import admin api:)
import module namespace admin = "http://marklogic.com/xdmp/admin"  at "/MarkLogic/admin.xqy";

(:Get the Config file of server:)

let $config := admin:get-configuration()

(: Get the Group ID file of server, if have created multiple Groups, please specify the Group name else it will be 'Default':)

let $groupid := admin:group-get-id($config, "Default")

(:
Below is the function for creating the Server,
It will take 7 parameters as mentioned below.
1. config file of Marklogic server.
2. Group ID
3. Server name which you want to create
4. Root directory, use '/' if you use module database else give the path of file directory.
5. New port no.
6. Module database Name, use 0 if you want to use filesystem directory instead of module database.
7. Main DB name 
:)

let $server-create := admin:http-server-create($config, $groupid, "myNewAppServer", "/", 8007, 0, xdmp:database("testing-db") )

(:Save the configuration file create by server functions:)

return admin:save-configuration($server-create)

WebDAV Server:

A WebDAV Server allows access to a database via a WebDAV client. A WebDAV server also allows HTTP access to the server, but you cannot execute XQuery code against it.

XDBC (XML Database Connector):

An XDBC Server is an App Server that accepts requests from an XCC(XML Contentbase Connector) or XDBC(XML Database Connector) client and returns the results to the client.

ODBC server(Open Database Connectivity):

The basic purpose of an ODBC server is to return relational-style data resident in MarkLogic Server in response to SQL queries. 


Database:

A database is a layer of abstraction between forests and HTTP, WebDAV, or XDBC servers.

A database is made up of data forests that are configured on hosts within the same cluster but not necessarily in the same group.
  • Multiple HTTP, XDBC, and WebDAV servers can be connected to the same database.

You can create an database through the Admin UI page of the MarkLogic server. Please refer the screenshot-2 for the same.

screenshot-2:
 



Or, You can also create an database with the help of the admin API function.
(:Import admin api:)
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
(:Get the Config file of server:)
let $config := admin:get-configuration()
(:
Below is the function for creating the Databases,
It will take 4 parameters as mentioned below.
1. config file of Marklogic server.
2. New DB name which you want to create
3. Specify the security Database name
4. Specify the  Schemas name
:)

let $DB-create := admin:database-create($config, "my-DB", xdmp:database("Security"), xdmp:database("Schemas"))

(:Save the configuration file create by DB functions:)
return admin:save-configuration($DB-create)


Modules Database:

The modules database is an auxiliary database that is used to store executable XQuery, JavaScript, and REST code. 
  • During installation, a database named Modules is created, but any database can be used as a modules database, as long as the HTTP or XDBC server is configured to use it as a modules database. 
  • Also, it is possible to use the same database to store executable modules, to store queryable documents, and/or to store triggers.
Please use the same approch for creating Module databases as mentioned for the Databases.

Forest:

A forest is a collection of XML, JSON, text, or binary documents. Forest are physically stored inside the data folder of the installed Marklogic directory:

Below is the screenshot:


  • A forest can only be attached to one database at a time. 
  • You cannot load data into a forest that is not attached to a database.

You can create an database through the Admin UI page of the MarkLogic server. Please refer the screenshot-3 for the same.

screenshot-3



Or, You can also create an forest with the help of the admin API function.

xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";

let $new-forest := admin:forest-create(admin:get-configuration(), "newForest", xdmp:host(), ())
return admin:save-configuration($new-forest)


Stands: Stands are small data sets of compressed document data. Stands are physically stored inside the Forest directory. Each stand contains actual compressed data of documents and indexes also.

Below is the screenshot of the stands.

Comments

Popular posts from this blog

Xquery

Marklogic Fundamentals