I am new to cassandra. Here I have two tables EVENTS
and TOWER
. I need to join those for some queries. But I\'m not enable to do it.
Struc
PlayOrm is a good option for doing joins on scalable systems with a special Scalable SQL language in which you can join partitions (ie. you never want to join 1 billion rows with another billion rows). It has tons of noSQL patterns and is a complete break from hibernate and JPA to mimic noSQL patterns with client side joins when needed.
There are a couple of ways that you can join tables together in Cassandra and query them. But of course you have to rethink the data model part.
Cassandra = No Joins. Your model is 100% relational. You need to rethink it for Cassandra. I would advice you take a look at these slides. They dig deep into how to model data for cassandra. Also here is a webinar covering the topic. But stop thinking foreign keys and joining tables, because if you need relations cassandra isn't the tool for the job.
But Why?
Because then you need to check consistency and do many other things that relational databases do and so you loose the performance and scalability that cassandra offers.
What can I do?
DENORMALIZE! Lots of data in one table? But the table will have too many columns!
So? Cassandra can handle a very large number of columns in a table.
The other thing you can do is to simulate the join in your client application. Match the two datasets in your code, but this will be very slow because you'll have to iterate over all your information.
Another way is to carry out multiple queries. Select the event you want, then the matching tower.