【发布时间】:2011-02-10 13:14:13
【问题描述】:
几天前我听说过 cassandra 数据库引擎,并正在寻找关于它的好文档。在学习了 cassandra 之后,我发现 cassandra 比其他数据引擎更具可扩展性。 我也在 Amazon SimpleDB 上阅读过,但由于 SimpleDB 有 10GB/表的限制,而且 Google Datastore 比 Amazon SimpleDB 慢,我不想使用它们(Google Datastore、Amazon SimpleDB)。因此,为了让我们的网站在海量数据中实现特别高的写入率,我喜欢使用 Cassandra 作为我们的数据引擎。
但在开始使用 cassandra 之前,我对“如何使用 casssandra 处理复杂数据”感到困惑。下面我给大家介绍一下MySQL数据库结构,请看这里给我一个好的建议。
用户表
hasColum ID 主要
hasColum 电子邮件唯一
hasColum 名字
hasColum 姓氏
分类表
hasColum ID 主要
hasColum 父级
hasColum 类别
帖子表
hasColum ID 主要
hasColum UID 索引外键链接到用户->ID
hasColum CID 索引外键链接到 Category->ID
has列标题
hasColum 帖子索引
hasColum PunDate
评论
hasColum ID 主要
hasColum UID 索引外键链接到用户->ID
hasColum PID 索引外键链接到 Posts->ID
hasColum 注释
用户组
hasColum ID 主要
有列名
UserToGroup 表(仅适用于多对多关系)
hasColum UID 外键链接到用户->ID
hasColum GID 外键链接到 Group->ID
最后供大家参考,我喜欢使用 SimpleCassie PHP Class http://code.google.com/p/simpletools-php/ 所以,如果你能给我举个使用 SimpleCassie 的例子,那将非常有帮助
【问题讨论】:
-
那么问题来了,在使用非关系型 NoSQL 数据库时如何建立关系?出于好奇,您正在构建什么 MySQL 无法扩展?
-
是的,这就是问题所在。我们正在考虑开发一个应用程序(主要是一个分类网关,网站开发人员将通过 API 设置/获取数据)。
标签: php database nosql cassandra