1. Hi All,


   1. I am trying to model  RDBMS joins into cassandra. As I am new to
   cassandra, I need your help/suggestion on this.  Below is the information
   regarding the query:
   2.
   3. I have a query in RDBMS as follows:
   4.
   5. select t3.name from  Table1 t1, Table2 t2, Table3 t3, Table4 t4 where
   6. t2.cust_id = 3 and t4.sid = t1.sid and t1.colid = t2.colid  and
   t4.cid = t3.cid
   7.
   8.
   9. Now, trying to make a shimilar query in cassandra:
   10.
   11. As per my learning experience in Cassandra, I got the below 2
   solutions: (as cassandra does not support joins)
   12.
   13. ****Solution 1:*****
   14.
   15. 1) Fetch all the records with t2.cust_id = 3
   16. 2) Now again run another query that will do the condition t3.sid =
   t1.sid on the results returned from point 1.
   17. 3) continue the same for all the conditions.
   18.
   19. Drawbacks with this approach:
   20.
   21. For each join, I have to do a network call to fetch the details.
   Also, it will take more time..as I am running multiple conditions
   22.
   23.
   24. ****Solution 2: *****
   25.
   26. 1) Create a map table for every possible join.
   27.
   28. Drawbacks with this aproach:
   29.
   30. I think, this is not a right approach. So join to table (map table)
   mapping idea is not right.
   31.
   32. pastebin link for the same: http://pastebin.com/FRAyihPT
   33. Please suggest me on this.

Reply via email to