A GraphDB-Enterprise cluster is organised as one or more master nodes that manage one or more worker nodes. Fail-over and load-balancing between worker nodes is automatic. Multiple (stand-by) master nodes ensure continuous cluster performance, even in the event of a master node failure. The cluster deployment can be modified when running, which allows worker nodes to be added during peak times, or released for maintenance, backup, etc. Such a set up guarantees a high performance always on service, which can handle millions of query requests per hour.
A cluster is made up of two basic node types: masters and workers. The cluster master manages and distributes atomic requests (query evaluations and update transactions) to a set of workers. A master node is responsible for:
Worker nodes are based on GraphDB-SE and are set up using the Sesame HTTP server (a Web application running inside a servlet container, e.g. Apache Tomcat). Master nodes do not store or manage any RDF data themselves (although it is possible to run a master and a worker instance on the same physical machine). From an external point of view, a master behaves exactly like any other Sesame/GraphDB repository that is exposed via the Sesame HTTP server, but utilises worker nodes (also exposed via a Sesame HTTP server) to store and manage RDF data. In this way, parallel query execution performance can be increased by having worker nodes answer queries in parallel.
Therefore, GraphDB-Enterprise has the following advantages over a stand-alone GraphDB-SE instance:
A master node of a GraphDB-Enterprise cluster implements the Sesame Repository interfaces and appears to clients like any other GraphDB instance. However, it does not store any RDF data itself, rather its function is to route queries and update requests to a set of GraphDB-SE instances (nodes).
A cluster can contain more than one master node. In this case, every master monitors the health of all workers and can distribute query execution tasks between them, effectively allowing a cluster to have multiple entry points for queries.
Worker nodes are GraphDB-SE repositories configured with identical rule-sets hosted in the openrdf-sesame Web application, running in a Java servlet container, such as Tomcat. They are accessible through the Master node via the HTTP protocol of the exported SPARQL endpoint of the Sesame service.
Every read request (SPARQL query) is passed to one of the available worker nodes. The node is chosen based on runtime statistics: number of queries currently running on that node and average query evaluation time. The available nodes are organised in a priority queue, which is rearranged after every read operation. If an error occurs (time-out, lost connection, etc), the request is resent to one of the other available nodes and so on until it is successfully processed.
Updates are handled in the following way: Each update is first logged. Then a probe node is selected and the request is sent to it. If the update is successful, any control queries are evaluated against it in order to check its consistency with respect to the data it holds. If this control suite passes, the update is forwarded to the rest of the nodes in the cluster. During the handling of an update the nodes that do not successfully process it are disabled and scheduled for recovery replication.
The master node can be configured with a set of control SPARQL queries, which may be only CONSTRUCT or ASK queries. The CONSTRUCT queries, when evaluated, check for the presence of the statements generated from the query. If any of these statements are missing, then a condition is raised and the control suite is considered as failed. An example of a control query could be the check for proper values respecting the rdfs:range of an arbitrary property, e.g.
The ASK queries raise conditions in the case that they return true (i.e. there is a sub-graph fulfilling the statement patterns of the query). An example of such a control query is the check for common members of mutually disjoint classes, e.g.
The file with the control queries can be preset using the <http://www.ontotext.com/trree/owlim#queriesFile> configuration parameter of the master node. The file format is the same as the one used in the GettingStarted demo application included in the GraphDB distribution.
For example, the following update will cause a synchronisation error, because the result of the update will be different for each worker node:
i.e. the value of ?timestamp will be set according to the clock and time of execution at each worker. After promulgating this update to all worker nodes, the master will detect a difference in each worker nodes signature (which will not match any previous state in its logs) and will trigger a full replication between the worker that first received the update and all other worker nodes.
During normal operations, the master node keeps the cluster synchronised by processing updates as described above. If a worker node becomes out of synch with the rest of the cluster, perhaps because it was offline or unreachable due to network problems, then the master node will detect this condition. If the auto-replication attribute is set to false, then a notification is sent and the cluster master switches in to read-only mode, i.e. it will not process any more updates. If desired, the startReplication operation can be used to start replication manually and when completed the worker node and cluster will return to normal status.
If the auto-replication attribute is set to true, or if replication is started manually, then the master will attempt to bring the problem worker node to the same state as the other worker nodes using one of the following replication methods:
Skip to end of metadata Go to start of metadata