php – 关于cassandra的复杂查询

几天前我在cassandra数据库引擎上听说过,并在上面搜索一个很好的文档.在研究了cassandra后,我得到的cassandra比其他数据引擎更具可扩展性.
我也在Amazon SimpleDB上阅读,但由于SimpleDB的限制为10GB / table,Google Datastore比Amazon SimpleDB慢,我不想使用它们(Google Datastore,Amazon SimpleDB).因此,为了使我们的网站使用大量数据扩展特别高的写入速率,我喜欢使用Cassandra作为我们的数据引擎.

但在开始使用cassandra之前,我对“如何使用casssandra处理复杂数据”感到困惑.我给你下面的MySQL数据库结构,请阅读这个并给我一个很好的建议.

用户表
hasColum ID主要
hasColum email唯一
hasColum FirstName
hasColum LastName

分类表
hasColum ID主要
hasColum Parent
hasColum类别

帖子表
hasColum ID主要
hasColum UID索引链接到users-> ID的外键
hasColum CID索引与Category-> ID链接的外键
hasColum标题
hasColum Post Index
hasColum PunDate

评论
hasColum ID主要
hasColum UID索引链接到users-> ID的外键
hasColum PID索引外键链接到Posts-> ID
hasColum评论

用户组
hasColum ID主要
hasColum名称

UserToGroup表(仅限多对多关系)
hasColum UID链接到Users-> ID的外键
hasColum GID外键链接到Group-> ID

最后,为了您的信息,我喜欢使用SimpleCassie PHP Class http://code.google.com/p/simpletools-php/
因此,如果您可以使用SimpleCassie给我示例,那将非常有用

解决方法:

cassandra’s wiki data model reference

Unlike with relational systems, where you model entities and relationships and then just add indexes to support whatever queries become necessary, with Cassandra you need to think about what queries you want to support efficiently ahead of time, and model appropriately. Since there are no automatically-provided indexes, you will be much closer to one ColumnFamily per query than you would have been with tables:queries relationally. Don’t be afraid to denormalize accordingly;

goog文章here.

我希望它对你有所帮助.

相关文章

校园网上订餐系统系统主要功能模块包括公告内容(公告栏、轮...
从今天开始,正式进入项目阶段。本次的项目是跟着黑马的瑞吉...
在可预见的将来,IT不会萎缩,只会越发展越庞大,最终会渗透...
vulntarget-b靶场最详细通关记录。
MongoDB是一个开源、高性能、支持海量数据存储的。
【NoSQL数据库技术与应用】课本代码、课后答案(持续更新)