cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohit Anchlia <>
Subject Re: Schema advice: (Single row or multiple row!?) How do I store millions of columns when I need to read a set of around 500 columns at a single read query using column names ?
Date Mon, 23 Jul 2012 18:27:07 GMT
On Mon, Jul 23, 2012 at 11:16 AM, Ertio Lew <> wrote:

> I want to read columns for a randomly selected list of userIds(completely
> random). I fetch the data using userIds(which would be used as column names
> in case of single row or as rowkeys incase of 1 row for each user) for a
> selected list of users. Assume that the application knows the list of
> userIds  which it has to demand from DB.

Since it's based on user keys it's best to store it as a row key. So one
row per userid and the row key would be the userid. You could also take a
different approach in case your userid is a no. you could do (userid -
(userid % noofusers)) as a row key. This will let you store multiple users
in one row and help with search as well. Since you know your data better
you can chose either one. There are other more involved ways but I think
either of the above should work for you.

View raw message