OrientDB can be distributed across different servers and used in different ways to achieve the maximum of performance, scalability and robustness.
OrientDB uses the Hazelcast Open Source project to manage the clustering. Many of the references in this page are linked to the Hazelcast official documentation to get more information about such topic.
In distributed mode the RID is assigned with cluster locality. If you have class Customer
and 3 nodes (node1, node2, node3), you'll have these clusters:
customer
with id=#15 (this is the default one, assigned to node1)customer_node2
with id=#16customer_node3
with id=#17So if you create a new Customer on node1, it will get the RID with cluster-id of "customer" cluster: #15. The same operation on node2 will generate a RID with cluster-id=16 and 17 on node3.
In this way RID never collides and each node can be a master on insertion without any conflicts.
Starting from v1.6, OrientDB supports distributed transactions. When a transaction is committed, all the updated records are sent across all the servers, so each server is responsible to commit the transaction. In case one or more nodes fail on commit, the quorum is checked. If the quorum has been respected, then the failing nodes are aligned to the winner nodes, otherwise all the nodes rollback the transaction.
During the distributed transaction, in case of rollback, there could be an amount of time when the records appear changed before they are rollbacked.
OrientDB v 2.0.x has some limitations you should notice when you work in Distributed Mode:
hotAlignment:true
could bring the database status as inconsistent. Please set it always to 'false`, the default