Inbound follows

Our new user_outbound_follows table allows us to efficiently find out who a user follows; since the partition key is the username of the following user, we'll only be accessing a single partition to answer the question. It does not, however, provide any way to find out who follows a certain user. In order to broadcast users' status updates to their followers, we'll certainly need to be able to find out who their followers are.

To accomplish this, we'll create a new table, which is the mirror image of user_outbound_follows:

CREATE TABLE "user_inbound_follows" (   "followed_username" text,   "follower_username" text,   PRIMARY KEY ("followed_username", "follower_username") );

The new user_inbound_follows table looks exactly like ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.