Cassandra PHP 模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2508649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cassandra PHP module
提问by Patrick
Anyone out there using Cassandra (http://cassandra.apache.org/) with PHP? What PHP module would you guys recommend to communicate between PHP and Cassandra?
有人在那里使用 Cassandra ( http://cassandra.apache.org/) 和 PHP 吗?你们推荐什么 PHP 模块来在 PHP 和 Cassandra 之间进行通信?
采纳答案by Schildmeijer
http://github.com/mjpearson/Pandra/tree/master
http://github.com/mjpearson/Pandra/tree/master
http://github.com/thobbs/phpcassa.git[port of pycassa to PHP]
http://github.com/thobbs/phpcassa.git[pycassa 到 PHP 的端口]
http://code.google.com/p/simpletools-php/wiki/SimpleCassie(ORM like wrapper)
http://code.google.com/p/simpletools-php/wiki/SimpleCassie(类似于包装器的 ORM)
For more high level API clients see ClientExampleson the Cassandra wiki.
有关更多高级 API 客户端,请参阅Cassandra wiki 上的ClientExamples。
回答by sdolgy
Although this is an old question, thobb's version of PHPCassahas become a nice standardfor PHP development with Apache Cassandra. The link referenced in the accepted question is to the hoan version of PHPCassa, which is not as current (last update was 2 years ago) or robust as the forked version that thobbsmaintains: https://github.com/thobbs/phpcassa
尽管这是一个老问题,但thobb 版本的 PHPCassa已成为使用Apache Cassandra进行 PHP 开发的一个很好的标准。接受的问题中引用的链接是 PHPCassa 的 hoan版本,它不像 thobbs维护的分叉版本那样最新(上次更新是 2 年前)或健壮:https: //github.com/thobbs/phpcassa
- Compatible with Cassandra 0.7, 0.8 and 1.x
- Optional C extension for improved performance
- 与 Cassandra 0.7、0.8 和 1.x 兼容
- 可选的 C 扩展以提高性能
I'm thoroughly happy with it, and have been for well over a year now. Continual development and you can see contributions being pushed upstream now from other developers.
我对它非常满意,并且已经一年多了。持续开发,您现在可以看到其他开发人员的贡献被推向上游。
You'll note that Pandrahasn't had any updates for quite some time too. +1yr
您会注意到Pandra也有很长一段时间没有任何更新了。+1 年
回答by Dustin Oprea
You can use Thrift.
您可以使用节俭。
Thrift was an infrastructure built by Facebook. Using a definitions file (ending with ".thrify"), it defines all services available on a given services and methods available from something. You can then generate headers for any supported language (PHP, Python, etc..), start the thrift server, and use the headers to transparently communicate with the Thrift server, which then communicates natively with whatever it is that you want to interact with. It works great and Cassandra supports it: https://wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP.
Thrift 是 Facebook 构建的基础设施。使用定义文件(以“.thrify”结尾),它定义了给定服务上可用的所有服务和某物可用的方法。然后,您可以为任何受支持的语言(PHP、Python 等)生成标头,启动 thrift 服务器,并使用标头与 Thrift 服务器进行透明通信,然后与您想与之交互的任何内容进行本机通信. 它运行良好,Cassandra 支持它:https: //wiki.fourkitchens.com/display/PF/Using+Cassandra+with+PHP。
If you want to know the calls that Cassandra has defined, just look in the Thrift definition.
如果您想知道 Cassandra 定义的调用,只需查看 Thrift 定义即可。
回答by RobinUS2
I would also like to suggest you to not directly connect to Cassandra if you're using PHP. You should better use a product like HAProxy to handle the connection pool instead of the most common PHPCassa. More about why can be found at my personal blog.
如果您使用 PHP,我还建议您不要直接连接到 Cassandra。你最好使用像HAProxy这样的产品来处理连接池,而不是最常见的PHPCassa。更多关于为什么可以在我的个人博客中找到。
回答by markcial
I'm just guessing, but it seems that uses something called thrift, im not very much into it, but i'll look for the page i had read lately about that, aaand there it is => http://wiki.apache.org/cassandra/ClientExamples03
我只是在猜测,但似乎使用了一种叫做 thrift 的东西,我不太喜欢它,但我会寻找我最近读过的关于它的页面,aaand 那里是 => http://wiki.apache .org/cassandra/ClientExamples03
回答by user320343
I am using Thrift API for accessing cassandra .. Mine is a php project.
我正在使用 Thrift API 访问 cassandra .. 我的是一个 php 项目。
回答by rmcfrazier
You can also check out PHP Binary CQL, which is a CQL client that uses the new binary protocol.
您还可以查看 PHP Binary CQL,这是一个使用新二进制协议的 CQL 客户端。
Blog post:
http://blog.robert.mcfrazier.com/php-binary-cql/
博文:http:
//blog.robert.mcfrazier.com/php-binary-cql/
Github: https://github.com/rmcfrazier/phpbinarycql
Github:https: //github.com/rmcfrazier/phpbinarycql
Disclosure: I'm the author of this library.
披露:我是这个图书馆的作者。

