Question

Anyone out there using Cassandra (http://cassandra.apache.org/) with PHP? What PHP module would you guys recommend to communicate between PHP and Cassandra?

Was it helpful?

Solution

http://github.com/mjpearson/Pandra/tree/master

http://github.com/thobbs/phpcassa.git [port of pycassa to PHP]

http://code.google.com/p/simpletools-php/wiki/SimpleCassie (ORM like wrapper)

For more high level API clients see ClientExamples on the Cassandra wiki.

OTHER TIPS

Although this is an old question, thobb's version of PHPCassa has become a nice standard for 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 thobbs maintains: https://github.com/thobbs/phpcassa

  • Compatible with Cassandra 0.7, 0.8 and 1.x
  • Optional C extension for improved performance

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 Pandra hasn't had any updates for quite some time too. +1yr

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 .

If you want to know the calls that Cassandra has defined, just look in the Thrift definition.

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.

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

I am using Thrift API for accessing cassandra .. Mine is a php project.

You can also check out PHP Binary CQL, which is a CQL client that uses the new binary protocol.

Blog post: http://blog.robert.mcfrazier.com/php-binary-cql/

Github: https://github.com/rmcfrazier/phpbinarycql

Disclosure: I'm the author of this library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top