Cassandra - alternate way for clustering key with ORDER BY and UPDATE
问题 My schema is : CREATE TABLE friends ( userId timeuuid, friendId timeuuid, status varchar, ts timeuuid, PRIMARY KEY (userId,friendId) ); CREATE TABLE friends_by_status ( userId timeuuid, friendId timeuuid, status varchar, ts timeuuid, PRIMARY KEY ((userId,status), ts) )with clustering order by (ts desc); Here, whenever a friend-request is made, I'll insert record in both tables. When I want to check one to one status of users, i'll use this query: SELECT status FROM friends WHERE userId=xxx