On Fri, Apr 2, 2010 at 10:06 AM, S Ahmed <sahmed1020@gmail.com> wrote:

Content management systems usually have complex sort operations, how would this be best handled with Cassandra?

Is the only way to handle this type of situation to build indexes for each and every sort?

example model:

Content: {
    contentID: {
        title: "this is a title",
        body: "this is the body"

       // now these are all columns that need to be sorted by
       isActive: "true",
       publishingStatus: 3, // enumeration
       revisionNumber: 234,
       dateCreated: "2010/03/03",
       dateModified: "2010/03/03",
       datePublished: "2010/03/06",
       authorID: 234,

The only solution I can think of is to create a seperate CF that maps the contentID and the column I need to sort by, so for dateCreated:

ContentDateCreatedSort : {
          contentID: { dateCreated: "2010/03/03" }

Am I on the right track here? Or is there a better way?

You're on the right track, denormalization is the best way to handle this.