TitanDB Graphs – How to Create Multiple Graphs with TitanDB and Cassandra

cassandragraph

I'm experimenting with TitanDB (with Cassandra as storage) + Rexter.

I've been reading the documentation during hours and trying to create multiple graph DBs on the same machine, but I didn't find the way to do it.

I find two main problems:

  • In the TitanDB docs, the Cassandra section tells how to create a graph on Cassandra, but the only parameters they comment are the host and the port, there isn't any reference to the graph name :s).
  • In the Rexter section we have essentially the same problem. We can define a list of named graphs, but every graph only can be mapped to a 3-tuple (backend type, host, and port).

The only way I can imagine is to instantiate more than one Cassandra server, and make that each Cassandra server listens to a different port. Then, configure Rexter to map every graph to a different cassandra instance.

There is a way to create more than one graph using the same Cassandra instance?

Best Answer

I had the same problem and, based on smurty's answer, I managed to do it by adding a new property 'storage.cassandra.keyspace' for each declared graph in rexster-cassandra-es.xml configuration file.

Since I'm using version 0.5.4 with default Cassandra+ElasticSearch configuration, this is the documentation that helped me.

Now I have one graph using the keyspace 'titan' (default value), and another one with the exact same configuration except for that property, which has value 'global'. In folder '$TITAN_HOME/db/cassandra/data' there are two folders, 'titan' and 'global', one for each graph's data.