简体   繁体   中英

How would I add cassandra support for symfony/doctrine?

I want to use Cassandra with Symfony. It is my first time using both technologies. I have conducted a lot of research into what has already been done, and it seems like there is no support for Cassandra from within Symfony (which uses Doctrine ORM). How difficult would it be for me to extend Doctrine to include support for Cassandra? What would be the best, cleanest, and most upgradable way to include this functionality?

There is a PDO driver for Cassandra's CQL: http://code.google.com/a/apache-extras.org/p/cassandra-pdo/

And as the Doctrine's DBAL is built ontop of PDO, I think it's possible to get at least partial functionality working.

Of course things like joins, indexes and entity relations are to be created manually and used with Cassandra's internal structure knowledge in mind.

Being a developer from Java world, I can say that there are Java ORM libraries for Cassandra with almost everything you have in your RDBMS working. So I guess it's possible after all.

Doctrine's ORM is for relational databases, that's why it's called an object relational mapper. A fundamentally different concept from a column oriented store such as Cassandra. I would say that the chances to get Cassandra in there are pretty slim.

Add to the work required that storage and access patterns are just not the same.

In Doctrine's ecosystem, there are people writing a ODM (object document mapper) which supports MongoDB and CouchDB - but a document oriented databases is also a different playground. Even those two are very different from each other while both are a document oriented database.

I don't think you can convince anyone to take on Cassandra in either of these projects.

For me personally, the biggest show-stopper for Cassandra is thrift and related which comes with it. Having said that, that's my personal opinion and nothing should hold you back from implementing a nice PHP wrapper for Cassandra.

I also see no reason to not release your Cassandra wrapper as a custom Symfony bundle, etc..

In the wake of Symfony2 lots of people started projects independent from core to provide bundles which cover an additional feature set (for example, Friends of Symfony ). So if you want to persue this, just go ahead and start something (eg on Github) and see how it is received.

I was actually looking for a Symfony2 bundle for Cassandra. The Cassandra wiki does have PHP clients for Cassandra.

http://wiki.apache.org/cassandra/ClientOptions

There is an active PHP client for cassandra: https://github.com/thobbs/phpcassa

Start there to avoid having to wrestle with the Thrift API directly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM