I am trying to create a nested data model in a cassandra database similar to:
Forums = {
forum001: {
name: "General News",
topics: {
topic000001: {
subject: "This is what I think",
date: "2012-08-24 10:12:13",
posts: {
post20120824.101213: { username: "tom", content: "Blah blah", datetime: "2012-08-24 10:12:13" }
post20120824.101513: { username: "dick", content: "Blah blah blah", datetime: "2012-08-24 10:15:13" }
post20120824.103213: { username: "harry", content: "Blah blah", datetime: "2012-08-24 10:32:13" }
}
},
topic000002: {
subject: "OMG Look at this",
date: "2012-08-24 10:42:13",
posts: {
post20120824.104213: { username: "tom", content: "Blah blah", datetime: "2012-08-24 10:42:13" }
post20120824.104523: { username: "dick", content: "Blah blah blah", datetime: "2012-08-24 10:45:23" }
post20120824.104821: { username: "harry", content: "Blah blah", datetime: "2012-08-24 10:48:21" }
}
}
}
},
forum002: {
name: "Specific News",
topics: {
topic000003: {
subject: "Whinge whine",
date: "2012-08-24 10:12:13",
posts: {
post20120824.101213: { username: "tom", content: "Blah blah", datetime: "2012-08-24 10:12:13" }
post20120824.101513: { username: "dick", content: "Blah blah blah", datetime: "2012-08-24 10:15:13" }
}
}
}
}
}
The basic design of the data is a bunch of nested maps within one another. I have read that this is not reasonable due to the difficulty of querying this data structure. What would be a better solution to this problem in order to structure the data in such a fashion?