cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Segalis <>
Subject Store a timeline with uniques properties
Date Thu, 30 Aug 2012 11:22:04 GMT
Hi everyone,

I'm trying to use cassandra in order to store a "timeline", but with values that must be unique
(replaced). (So not really a timeline, but didn't find a better word for it)

Let's me give you an example :

- An user have a list of friends
- Friends can change their nickname, status, profile picture, etc...

at the beginning the CF will look like that for user1: 

lte = latest-timestamp-entry, which is the timestamp of the entry (-1 -2 -3 means that the
timestamp are older)

user1 row :			|		lte			|		lte -1		|		lte -2		| 		lte -3		|		lte -4		|
		values :		| user2-name-change | user3-pic-change	| user4-status-change | user2-pic-change
| user2-status-change |

If for example, user2 changes it's picture, the row should look like that : 

user1 row :			|		lte			|		lte -1		|		lte -2		| 		lte -3		|		lte -4		 |
		values :		|   user2-pic-change	| user2-name-change | user3-pic-change	| user4-status-change
| user2-status-change |

notice that user2-pic-change in the first representation (lte -3) has "moved" to the (lte)
on the second representation.

That way when user1 connects again, It can retrieve only informations that occurred between
the last time he connected.

e.g. : if the user1's last connexion date it between "lte -2" and "lte -3", then he will only
be notified that :

- user2 has changed his picture
- user2 has changed his name
- user3 has changed his picture

I would not keep the old data since the "timeline" is saved locally on the client, and not
on the server.
I really would like not to search for each column in order to find the "user2-pic-change",
that can be long especially if the user has many friends.

Is there a simple way to do that with cassandra, or I am bound to create another CF, with
column title holding the action e.g. "user2-pic-change" and for value the timestamp when it
appears ?



View raw message