Re: Cassandra Design or another solution

2010-04-05 Thread JKnight JKnight
Thanks for your help, David. On Mon, Apr 5, 2010 at 7:25 PM, Andriy Bohdan wrote: > It makes sense. > > Thanks, David! > > On Mon, Apr 5, 2010 at 2:34 PM, David Timothy Strauss > wrote: > > Cache the => map as you write values (a > "write-through" cache) so that reading the current score hi

Re: Cassandra Design or another solution

2010-04-05 Thread Andriy Bohdan
It makes sense. Thanks, David! On Mon, Apr 5, 2010 at 2:34 PM, David Timothy Strauss wrote: > Cache the => map as you write values (a > "write-through" cache) so that reading the current score hits something like > memcached instead of Cassandra. With a cache hit, you get an ideal, > write-

Re: Cassandra Design or another solution

2010-04-05 Thread David Timothy Strauss
Cache the => map as you write values (a "write-through" cache) so that reading the current score hits something like memcached instead of Cassandra. With a cache hit, you get an ideal, write-only path in Cassandra. Three blind writes in Cassandra is cheap -- no matter what your scale. The only

Re: Cassandra Design or another solution

2010-04-05 Thread David Timothy Strauss
In any case, the common approach to this in Cassandra is to not directly manipulate the user's total score but to insert columns representing changes to the score, later totaling them (and possibly inserting them elsewhere so you get the automatic sort). There are many fancy ways to approach th

Re: Cassandra Design or another solution

2010-04-05 Thread David Timothy Strauss
If user scores move in more than one direction, as they apparently do in your case, they are not monotonic. Monotonicity can make system design a bit easier for various reasons. - "JKnight JKnight" wrote: Thanks David, But what's does "monotonicity" mean? User's score belongs to thei

Re: Cassandra Design or another solution

2010-04-05 Thread Andriy Bohdan
Hello guys I have a pretty similar task. There's a need to store tags of products with score. Score may go up and down and tags have to be ordered by their score for each product. Score is updated "very" often. I was thinking of using the following model (simplified here for clarity): Product =

Re: Cassandra Design or another solution

2010-04-05 Thread JKnight JKnight
Thanks David, But what's does "monotonicity" mean? User's score belongs to their action. When they win the game or sale something, user's score will increase. When user lose the game or buy something, user's score will decrease. On Mon, Apr 5, 2010 at 4:09 AM, David Strauss wrote: > I need the

Re: Cassandra Design or another solution

2010-04-05 Thread David Strauss
I need the question about monotonicity answered, too. You should also know: Cassandra is not ideal for directly tracking values you increment or decrement. On 2010-04-05 08:04, JKnight JKnight wrote: > Thanks for for reply, David. > > I will tell more the detail about the system. My system is us

Re: Cassandra Design or another solution

2010-04-05 Thread JKnight JKnight
Thanks for for reply, David. I will tell more the detail about the system. My system is used to store the score (point) user earn when they play game. "Mark" is the score. User's score changes when user win game, buy or sell anything. Sorry I make a mistake. My data model is: Mark{ //Column Fam

Re: Cassandra Design or another solution

2010-04-04 Thread David Strauss
On 2010-04-05 02:48, JKnight JKnight wrote: > I want to design the data storage to store user's mark for a large > amount of user. When system run, user's mark changes frequently. What is a "mark"? > I want to list top 10 user have largest mark. Do the "marks" increase monotonically? What other

Cassandra Design or another solution

2010-04-04 Thread JKnight JKnight
Dear all, I want to design the data storage to store user's mark for a large amount of user. When system run, user's mark changes frequently. I want to list top 10 user have largest mark. Could we use Cassandra for store this data? Ex, here my Cassandra data model design: Mark{ userId{