incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshni Rajagopal <>
Subject Data Model
Date Thu, 13 Sep 2012 17:54:51 GMT

I want to learn how we can model a mix of static and dynamic columns in a family.
Consider a course_students col family which gives a list of students for a coursewith row
key- Course IdColumns - Name, Teach_Nm, StudID1, StudID2, StudID3Values - Maths, Prof. Abc,
20,21,25 where 20,21,25 are IDs of students.
We have
fixed columns like Course Name, Teacher Name, and a dynamic number of
columns like 'StudID1', 'StudID2' etc, and my thoughts were that we could
look for 'StudID' and get all the columns with the student Ids in Hector. But the
question was how would we determine the number for the column, like to add
StudID3 we need to read the row and identify that 2 students are there,
and this is the third one.

So we can remove the number in the column name, altogether and keep
columns like Course Name, Teacher Name, Student:20,Student:21, Student:25,
where the second part is the actual student id. However here we run into
the second issue that we cannot have some columns of a composite format
and some of another format, when we use static column families- all
columns would need to be in the format UTF8:integer We may want to treat
it as a composite column key and not use a delimiter- to get sorting,
validate the types of the parts of the key, not have to search for the
delimiter and separate the 2 components  manually etc. 

A third option is to put only data in the column name for students like
Course Name, Teacher Name, 20,21,25 - it would be difficult to identify
that columns with name 20, 21, 25 actually stand for student names - a bit

I hope this is not confusing, and would like to hear your thoughts on this.The question isaround
when you de-normalize & want to have some static info like name ,and a dynamic list -
whats the best way to model this.
View raw message