I came across this issue, and I just can't figure out what to do, so say i'm keeping these user actions:
- Likes
- Comments
- Shares
- Uploads
And so on, list goes to around 20
actions, now the best strategy i came up with is to create a single CF let's call it user_actions
and then use composite rows (i think that's how they are called).
So rows would consist of user_id:action
, now i think some people would ask why not just store all user actions in a single row? Well here is my biggest problem, because i want user to have an option to choose user wants to see when say he want's to check what his friends or he him self did in the past.
So say user wants to see what his friend liked, all i need to do is get that row with all of those likes, simple right?
But what if user wants to see everything
(which is the default option), in that case i would need to make ~20
queries, well i guess that would be okay with a little traffic, but what if i have 100k reads each second that would mean 100k * 20, and it sounds horrible...
But i just can't see any other way, because if i would store everything in a single row how would i query individual actions when cassandra doesn't support WHERE
?
By the way i'm using php
and phpcassa
lybrary.