Abuti
Abuti

Reputation: 27

MarkLogic: Understanding Schemas, Triggers, and Modules (with Examples)

I'm just starting to use MarkLogic and need guidance on effectively utilizing Schemas, Triggers, and Modules. I am not sure I am understanding how to create them nor what their uses are. When creating a database do you need to also create Schemas, Triggers, and Modules? If so, do you just create it the same way you create any database or is a there a different configuration? I am not sure if my question even makes sense. I am very lost and would love any support on simplify these concepts to me.

I am working on a project to write a documentation that explains how to restore a MarkLogic database from server A to server B. I was instructed that I should have four sample database; SampleDoc, SampleModule, SampleSchema, SampleTrigger. and each of these should at least have two forests.

I have looked at the documentation on Marklogic and everything passed through my head. I did not understand most of it, which is the reason I came on here.

Upvotes: 0

Views: 79

Answers (1)

Florent Georges
Florent Georges

Reputation: 2327

A MarkLogic database has 3 linked databases:

  • security
  • schemas (optional)
  • triggers (optional)

As you could imagine, the former contains information about security (users, privileges, etc.,) the second one contains information about content structure (XML schemas, TDE, etc.,) the latter contains triggers applicable to the content.

The last two are optional, so you don't have to provide any if you don't use them. The security database is mandatory. It is usual to have a single one database attached as the security database to all databases (including to itself.) The default security database created when you install MarkLogic is named Security. Unless necessary, you can keep this single one security database.

An appserver has 3 linked database:

  • content
  • modules
  • last-login (optional)

The modules database is "mandatory," but can be a special value to say that modules are on the file system (so in that case there is no modules database.)

As for the forests to associate to these databases, the rule of thumb is: security, modules, triggers, schemas databases should have a single forest. The content database must have several forests, how many precisely depending on its content and how you use it. The following article contains more details on that.

Remember that a database is a logical content set, when its forests are its (distributed) storage.

Upvotes: 2

Related Questions