我正在寻找一种好方法来存储卡桑德拉的意见。 有人可以为我提供一个好的Cassandra数据模型来存储注释吗?卡桑德拉模式的意见
数据模型应该让我找回一定数量的这些意见与phpcassa。
这是我的想法:
Comments = {
CommentId1:{
CommentAuthor,
Content,
Timestamp
},
CommentId2:{
CommentAuthor,
Content,
Timestamp
}
...
}
CommentsLine = {
EntryId1:{
CommentId1: timestamp,
CommentId2: timestamp,
CommentId3: timestamp,
...
}
...
}
,但我不知道这是更好的办法。感谢您的帮助。
在我的解决方案,如果要排序的意见,您可以通过一个简单的切片从职位表中获取它在列存储{发布时间戳} - > {{评论者的用户ID}和其他元数据作为JSON} – MaX 2012-07-12 15:41:57
是也许。我不知道你的模式,但在这个例子中,最好使用rowkey中的列来保持你的评论排序。 – sahid 2012-07-12 15:50:48
@sahid好吧,但我如何才能得到前5个结果,然后另外5个结果ecc ...? – siannone 2012-07-13 13:49:47