title: Cassandra/Redis: Way to create feed without Cassandra 'IN' secondary index?
body: <p>I'm having a bit of an issue with my application functionality integrating with Cassandra. I'm trying to create a content feed for my <code>users</code>. Users can create posts which, in turn, have the field <code>user_id</code>. I'm using Redis for the entire social graph and using Cassandra columns solely for objects. In Redis, user 1 has a set named <code>user:1:followers</code> with all of his/her follower ids. These follower ids correspond with the Cassandra ids in the users table and user_ids in the posts table.</p>
  
  <p>My goal was originally to simply plug all of the <code>user_id</code>s from this Redis set into a query that would use <code>FROM posts WHERE user_id IN (user_ids here)</code> and grab all of the posts from the secondary index <code>user_id</code>. The issue is that Cassandra purposely does not <a href="https://issues.apache.org/jira/browse/CASSANDRA-6318" rel="nofollow">support</a> the <code>IN</code> operator in secondary indexes because that index would force Cassandra to search ALL of its nodes for that value. I'm left with only two options I can see: Either create a Redis list of <code>user:1:follow_feed</code> for the post IDs then search Cassandra's primary index for those posts in a single query, or keep it the way I have it now and run an individual query for every <code>user_id</code> in the <code>user:1:follower</code> set.</p>
  
  <p>I'm really leaning against the first option because I already have tons and tons of graph data in Redis, and this option would add a new list for every user. The second way is far worse. I would put a massive read load on Cassandra and it would take a long time to run individual queries for a set of ids. I'm kind of stuck between a rock and a hard place, as far as I see it. Is there any way to query the secondary indexes with multiple values? If not, is there a more efficient way to load these content feeds (RAM and speed wise) compared to the options of more Redis lists or multiple Cassandra queries? Thanks in advance.</p>