Storing follow relationships

We've now created two tables, each of which allows us to answer two important questions about follow relationships: first, whom a user follows; and second, who follows a user. Now let's establish some follow relationships.

For now, let's have alice follow a couple of other users, bob and carol:

INSERT INTO "user_outbound_follows"   ("follower_username", "followed_username") VALUES ('alice', 'bob'); INSERT INTO "user_inbound_follows"   ("followed_username", "follower_username") VALUES ('bob', 'alice'); INSERT INTO "user_outbound_follows"   ("follower_username", "followed_username") VALUES ('alice', 'carol'); INSERT INTO "user_inbound_follows"   ("followed_username", "follower_username") VALUES ('carol', 'alice'); ...

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.