educative.io

Educative

Sharding based on TweetID with Cassandra

Hi,
From this system design, I’ve learnt by sharding on TweetID it would avoid hotspot that can be caused by sharding by user id. This is understood. If we use Cassandra as nosql database for restoring/restriving tweetid and use tweeid as as partition, how to formulate the query? In this case, where clause must be on the partition key not user id. I would assume the steps are: get the followers from the user, the retrieve tweets id from the followers. I am not able to formulate the query when partition id is not user id.

Thanks,
Coco


Type your question above this line.

Course: https://www.educative.io/collection/5668639101419520/5649050225344512
Lesson: https://www.educative.io/collection/page/5668639101419520/5649050225344512/5741031244955648