Note that there are some explanatory texts on larger screens.

plurals
  1. POCassandra, storing various events about item
    primarykey
    data
    text
    <p>I need to store these types of events for let's say uploaded song:</p> <ul> <li>Views</li> <li>Likes</li> <li>Dislikes</li> <li>Comments</li> <li>Favorites</li> <li>Downloads</li> </ul> <p>And there might be even more.</p> <p>To store information about song itself I am using wide rows, where column name is timestamp and value is <code>JSON</code> string with all information about that song.</p> <p>Now there wouldn't be much of the problem if i would only need to store numbers, but i actually need to store information about the user who say liked that song.</p> <p>So if 1000 users liked some song putting all of that info in just one column would probably be a bad idea.</p> <p>So the only way i could probably do that is to store that information in a different CF.</p> <p>But i'm not sure how would "connect" song itself with all that info scattered in different column/s?</p> <p>So my question is, am i going in the right direction, and if so how would i store all those actions and connect them together.</p> <p><strong>EDIT</strong></p> <p>I am trying to build likes system, and it's getting almost out of hand, these are the actions i need to perform in order to like/dislike</p> <ol> <li>Check if user already liked that item</li> <li>Check if user disliked that item before</li> <li>If he did dislike, then remove that entry</li> <li>Now get current likes</li> <li>And now update item itself, set new likes count</li> <li>Update <code>CF</code> which contains all user who liked that item</li> </ol> <p>And there is actually couple more querys that i need to run, so in total i get almost 6 querys or even more is that normal?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload