几天前我听说过 cassandra 数据库引擎,并正在寻找关于它的好文档。在学习了 cassandra 之后,我发现 cassandra 比其他数据引擎更具可扩展性。我也在 Amazon SimpleDB 上阅读过,但由于 SimpleDB 有 10GB/表的限制,而且 Google Datastore 比 Amazon SimpleDB 慢,我不想使用它们(Google Datastore、Amazon SimpleDB)。因此,为了使我们的网站在海量数据中实现特别高的写入率,我喜欢使用 Cassandra 作为我们的数据引擎。
但在开始使用 cassandra 之前,我对“如何使用 casssandra 处理复杂数据”感到困惑。我给你下面的MySQL数据库结构,请阅读这个并给我一个好的建议。
用户表
hasColum ID 主要
hasColum 电子邮件 唯一
hasColum FirstName
hasColum LastName
类别表
hasColum ID Primary
hasColum Parent
hasColum Category
Posts Table
hasColum ID Primary
hasColum UID Index外键链接到用户->ID
hasColum CID Index外键链接到Category->ID
hasColum Title
hasColum Post Index
hasColum PunDate
评论
hasColum ID 主
hasColum UID 索引外键链接到用户->ID
hasColum PID 索引外键链接到帖子->ID
hasColum 评论
用户组
hasColum ID 主
hasColum 名称
UserToGroup 表(仅用于多对多关系)
hasColum UID 外键链接到 Users->ID
hasColum GID 外键链接到 Group->ID
最后供您参考,我喜欢使用 SimpleCassie PHP 类http://code.google.com/p/simpletools-php/ 所以,如果您能给我举个使用 SimpleCassie 的例子,那将非常有帮助