educative.io

Trying to understand the relationship between the user, follower and the tweet


#1

If we are using epoch time for storing the tweet, i understand that the consistent hashing will take care of distributing the tweet across the shard.

In Cassandra you cannot filter the table on the primary key, here it is the timstamp. So you basically cannot use ‘where tweet_id < timestamp’ on the table. You just have to pull them by using 'where tweet_id = '.

Does this mean we have to store the user - tweet relationship somewhere? for example the following is the list of tabes.

user
user_follower
user_tweet . [ user-id, tweet_id]
tweet [tweet-id, text, … ]

So in order to get the list of all the tweets of the people i’m following, i have to navigate from user -> user_follower -> user_tweet -> tweet. Is my understanding right? or is it something else?