38

I'm looking to use a NoSQL solution for my next project, which will be written in PHP. What choices do I have in terms of NoSQL solutions that can easily interfaced via PHP? I haven't done much thinking about the architecture yet, so I'm not sure what my needs will be; I'd simply like to know what my choices are so I don't build something I can't reasonably implement.

For instance, I know Cassandra has Pandra, but that's just a PHP library. MongoDB has a native PECL extension.

mattbasta
  • 13,492
  • 9
  • 47
  • 68
  • 3
    What's wrong with using the PHP library? – Mitch Dempsey May 12 '10 at 19:18
  • 2
    This may not be a good fit for Stackoverflow as per Gordon, however I found valuable information in the responses. – Jon Jul 29 '14 at 03:39
  • There are several options, Aerospike's open source - (https://github.com/aerospike/aerospike-server) is the new one I have been playing around with lately and I'm digging it for php. They have some useful sample scripts in their php client. – Ezos Sep 05 '14 at 23:43

4 Answers4

30

I wrote the PHP driver for MongoDB and I think it's a great interface :)

The mongo PECL package is not only pretty mature (comparatively... nearly a year and a half old now!) and fairly thoroughly documented, it is really widely used. If you check out MongoDB's PHP page, you can see that there are ways of integrating it with Cake, Doctrine, Drupal, Kohana, Symfony, and Zend, as well as a couple admin GUIs (like PHPMoAdmin) and several of it's own ODMs (object document mappers).

P.S. salathe has a good point, though, the best solution is really going to depend on what you're doing.

kris
  • 23,024
  • 10
  • 70
  • 79
  • 1
    dude I just saw the docs for the driver and im puking rainbows. So much cleaner than working with PDO! Seriously on the edge of switching to MongoDB because of this interface! – felixfbecker Jul 16 '15 at 19:17
  • 404 https://www.php.net/manual/en/book.mongo.php – ESP32 Jan 16 '22 at 00:16
15

CouchDB has PHPillow:

PHPillow is an object orientated wrapper for CouchDB. Releases can be found on the downloads page. Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language.

Also see http://nosql-database.org for a good overview.

Gordon
  • 312,688
  • 75
  • 539
  • 559
9

a NoSQL solution

Your question is very vague, whether you intended it or not. Without knowing that you are wanting to get out of the NoSQL solution then any recommendations would just be naming names (not necessarily a bad thing, but nothing that you can't Google yourself in a few minutes). For example, the two that you name above (Cassandra and MongoDB) are different animals: to base the choice on friendliness seems a little short-sighted.

So, could you have a think about it, then come and elaborate on the project (no need to divulge details; general approaches, wants and desires, that sort of thing) to aid us in helping you move towards a choice?

P.S. This is only an "answer" because it's too long for a comment. Waffley fingers!

P.P.S. Not that it means anything, but I am quite the fan of MongoDB... with PHP or otherwise.

salathe
  • 51,324
  • 12
  • 104
  • 132
0

I have not tried it yet myself, but it's on my to do list: trying out mongo with php.

koen
  • 13,349
  • 10
  • 46
  • 51