php – 关于cassandra的复杂查询
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了php – 关于cassandra的复杂查询,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1720字,纯文字阅读大概需要3分钟。
内容图文
几天前我在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.
我希望它对你有所帮助.
内容总结
以上是互联网集市为您收集整理的php – 关于cassandra的复杂查询全部内容,希望文章能够帮你解决php – 关于cassandra的复杂查询所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。