5 ms·
In each of the two examples he defines a way of tracking both who you're following and who is following you by implementing two tables in SQL or two "column sto
by WesleyJohnson 16y ago
In each of the two examples he defines a way of tracking both who you're following and who is following you by implementing two tables in SQL or two "column stores" in Cassandra.
Why would you need to (or want to) store these separately? A table indicating User X is following User Y would give you enough to fullfill queries for both followers and followees.
- strebler 16y agoIn a database, yes, a single table with two indexes would efficiently look up followings/followers. But in Cassandra there is no support for secondary indexes, so the follower/following data needs to be in separate column families. Then, they each have an index and can be looked up efficiently. (At least as far as I understand things in the NoSQL world)
- dagheti 16y agoSo what happens when you create the follower but not followed index then realize you need it. Is there a way to create that new ColumnFamily without writing a object-by-object program that must traverse all the data? I suppose the concept of data locality doesn't apply, but what is the best way to do that sort of operation?
- buss 16y agoYou'd write a MapReduce program to do it. Cassandra 0.6 has full support for Hadoop.