Which MongoDB library to use for a stand-alone PHP project with Symfony?

I am leading a new project where we are convinced that MongoDB is the right choice for the database. We decided that the architecture would be SOA, so the web part would be developed using Symfony, and the service part would be developed using the lightweight REST Tonic framework.

Now, in terms of maintenance, we will communicate with MongoDB, and for this we examined a number of available MongoDB libraries: Doctrine MongoDB ODM , Mondango , ActiveMongo , MongoRecord , etc. However, we are not sure which one to choose.

I was wondering if anyone could share their experiences with these libraries so that we could make the right choice. Here are some of the properties that we consider a library:

  • Common PHP classes for defining documents (instead of array / configuration files)
  • Link Support
  • Operations efficiency
  • Easy to understand API

Looking forward to your views!

+4
source share
1 answer

Personally, I would go with Doctrine2 ODM. As you have already decided on Symfony, as your framework for heavy lifting of the pair is well coordinated, as I understand it. You should be able to use https://github.com/doctrine/DoctrineMongoDBBundle to quickly integrate the two.

The doctrine node sets up all the fields that you set for the purposes of your project, and they are pretty easy to work with. Most importantly, this is an active project, so bug fixes / features / documentation updates occur fairly regularly.

We use a similar setup, except for the zend framework instead of Symfony, and we are very pleased with the results.

Hope this helps.

+2
source

Source: https://habr.com/ru/post/1403080/


All Articles