Skip to main content

Administrating MarkLogic Server

Range Partitions

A range partition consists of a group of database forests that share the same name prefix and the same range assignment policy described in Range Assignment Policy.

Note

When deploying forests in a cluster, you should align forests and forest replicas across hosts for parallelization and high availability, as described in the Scalability, Availability, and Failover Guide.

The range of a partition defines the scope of element or attribute values for the documents to be stored in the partition. This element or attribute is called the partition key. The partition key is based on a range index, collection lexicon, or field set on the database. The partition key is set on the database and the partition range is set on the partition, so you can have several partitions in a database with different ranges.

For example, you have a database, named WorkingVolumes, that contains nine forests that are grouped into three partitions. Among the range indexes in the WorkingVolumes database is an element range index for the update-date element with a type of date. The WorkingVolumes database has its partition key set on the update-date range index. Each forest in the WorkingVolumes database contains a lower bound and upper bound range value of type date that defines which documents are to be stored in which forests, as shown in the following table:

Partition Name

Forest Name (prefix-name)

Partition Range Lower Bound

Partition Range Upper Bound

Lower Bound Included

Vol1

Vol1-0001 Vol1-0002

2010-01-01

2011-01-01

false

Vol2

Vol2-0001 Vol2-0002 Vol2-0003

2011-01-01

2012-01-01

false

Vol3

Vol3-0001 Vol3-0002 Vol3-0003 Vol3-0004

2012-01-01

2013-01-01

false

Note

When Lower Bound Included is set to false on a database, the lower bound of the partition ranges are ignored. With this setting, documents with a partition key value that match the lower bound value are excluded from the partition and documents that match the upper bound value are included.

In this example, a document with an update-date element value of 2011-05-22 would be stored in one of the forests in the Vol2 partition. Should the update-date element value in the document get updated to 2012-01-02 or later, the document will be automatically moved to the Vol3 partition. How the documents are redistributed among the partitions is handled by the database rebalancer, as described in Range Assignment Policy.

Below is an illustration of the WorkingVolumes database, showing its range indexes, partition key, and its partitions and forests:

Illustration of the WorkingVolumes database, showing its range indexes, partition key, and its partitions and forests.