incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raj Bakhru <rbak...@gmail.com>
Subject revisioned data
Date Sat, 05 Feb 2011 22:28:16 GMT
Hi all -

We're new to Cassandra and have read plenty on the data model, but we wanted
to poll for thoughts on how to best handle this structure.

We have simple objects that have and ID and we want to maintain a history of
all the revisions.

e.g.
MyObject:
    ID (long)
    name
    other fields
    update time (long [date])


Any time the object changes, we'll store down a new version of the object
(same ID, but different update time and other fields).  We need to be able
to query out what the object was as-of any time historically.  We also need
to be able to query out what some or all of the items of this object type
were as-of any time historically..

In SQL, we'd just find the max(id) where update time < queried_as_of_time

In Cassandra, we were thinking of modeling as follows:

CF:  MyObjectType
Super-Column: ID of object (e.g. 625)
Column:  updatetime  (e.g. "1000245242")
Value: byte[] of serialized object

We were thinking of using the OrderingPartitioner and using range queries
against the data.

Does this make sense?  Are we approaching this in the wrong way?

Thanks a lot

Mime
View raw message