问题
I have a situation where each user of the system can have their own graph of million vertices and lot more edges. I want to implement it as separate graph for each user.
So, if there are a billion plus users, how many graphs can i created in a clustered Titan DB with DynamoDB backend?
Should i create multiple separate TitanDB instances and spread the load if a limitation exists?
The reason i need this is that most activity on the graph is within what the user owns. Cross user activity can be low and sporadic.
I looked at this Titan Graph DB Limitations document for limitations but it only talks of limits on vertices and edges. Also, all documentation links when we search for on google are hitting the DataStax homepage with no niformation where in there i can find the documentation.
Also, Can you let me know how to create separate graph instances as needed?
回答1:
You can have multiple graphs within the same persistence layer. For example with Cassandra if you had the following configs:
conf1:
storage.cassandra.keyspace=name1
conf2:
storage.cassandra.keyspace=name2
conf3:
storage.cassandra.keyspace=name3
Then you could create multiple graphs within that persistence layer using:
graph1 = TitanFactory.open(conf1)
graph2 = TitanFactory.open(conf2)
graph3 = TitanFactory.open(conf3)
If you are asking how do you create multiple graphs within the same TitanFactory.open()
, that you cannot do in a straightforward manner.
What you can do is create several disconnected graphs in the same graph. For example:
graph1 = TitanFactory.open(conf)
//Create One Disconnected Graph
v1 = graph.addVertex();
v2 = graph.addVertex();
v1.addEdge("edge", v2);
//Create Another Disconnected Graph
v3 = graph.addVertex();
v4 = graph.addVertex();
v3.addEdge("edge", v4);
The above effectively gives you two sub-graphs within the same graph.
My personal recommendation is that if you don't need any connections between your graphs then you should use multiple graphs. I.e. graph1
, graph2
, and graph3
as I specified above. This will make scaling easier in the long run. Of course be very certain that connections are not needed.
来源:https://stackoverflow.com/questions/40512545/how-many-graphs-can-i-create-in-one-titan-db