storing tree/graph structure in Cassandra

Viewed 366

I am newbie to Cassandra DB, i am planning to design a schema where i cab store a tree structure in Cassandra-DB. The tree structure which i planned to store will be similar to a directory structure. The tree structure will be as below(the size is not restricted as depicted below, but it may vary for each level) enter image description here

what would be an idle way to implement this functionality, also do we need a graph Db to store the tree and integrate with Cassandra.

Any Help and suggestions on how to achieve this is appreciated.

Thanks in Advance

1 Answers

I would definitely look at a graph database.

There really isn't a good way to implement this given Cassandra's data model constraints. With Cassandra, you need to store data according to how you plan to query it. With graph traversals, query payloads tend to vary on the query and algorithm used. Also, graph databases have a graph traversal engine; without that you'll have to augment it on the application side.

tl;dr;

Cassandra is not a good fit here. This is clearly a case where a graph database is the right tool for the job.

Related