I am new to Cassandra and i did an online search about modelling of hierarchical entities in Cassandra but i couldn't find anything.
I tried classical relational db approach in which you store parent ids but that don't seem to work in nosql world.
So basically i have hierarchical entities (parent-child relationship), how should i create my tables for efficient querying on Cassandra?
I have packages and products. I put products in packages and i can also put packages in packages which contain products and packages and so on.
To have a good understanding of how Cassandra modelling works, you should first see some tutorials on datastax academy or see some videos online.
In any case, what you need to think about is how your data will be accessed.
For example, let's say you only needs to have all the products and packages in a package, then you will only need a package table, with a column for the packages and one for the products.
Now if you want to see in which packages lies a product, the model above is wrong, and you need to make another table that will store every packages that contain a given product.
I think you see where I am going: it's impossible to find a good model if we don't know how it will be used.
Also, look at this more in-depth example: http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With