-
Notifications
You must be signed in to change notification settings - Fork 94
Description
I've been scripting up (in Java) a routine to create and define a graph. I'm experimenting with an Arango 3 node cluster, so wanted to specify a replication factor of 3 and number of shards to 3 for all my Vertex and Edge collections.
I created a new graph using the Arango.createGraph() interface specifying a GraphCreateOptions object where I set the replication factor and number of shards to 3. Post creation I observe that these values are correctly set against the graph in the web console. Due to the way I need to sequence my creation script, I create an empty graph first (so not supplying any Edge definitions to the createGraph() call), and then add in the Edge definitions in a following step.
When I then use the ArangoGraph.addEdgeDefinition() interface to add in my Vertex and Edge collections, although the method call creates the collections, the number of replicas and shards is always set to 1. I am currently working around this problem by creating the collections first using the createCollection() interface, where I specify a CollectionCreateOptions object with the replicas and shards set to 3. I then call the addEdgeDefintion() interface to add these pre-created collections into my graph. The collections then correctly show the number of replicas and shards.
So I have the following questions:-
-
If the graph has been created with 3 replicas and 3 shards, why does the creation of the collections supporting the vertices and edges result in collections with 1 replica and 1 shard?
-
What purpose does the Replicas and Shards setting on the Graph serve?
My suggestion would be that the addEdgeCollection() interface should inherit the setting on the graph for replicas and shards when creating the collections. Also could the EdgeDefintion object be extended to support these settings in a similar may to CollectionCreateOptions?
Thanks
Andrew