Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Support for MongoDB Driver #299

Closed
lopezio opened this issue Jul 19, 2017 · 4 comments
Closed

Support for MongoDB Driver #299

lopezio opened this issue Jul 19, 2017 · 4 comments

Comments

@lopezio
Copy link

lopezio commented Jul 19, 2017

Hi Folks,

Is anyone here already working on switching to the new PHP MongoDB Driver ( http://php.net/manual/en/set.mongodb.php )? Particularly the connection pooling of it is very interesting. If no one is working on it, I can give it a take and then hand it over.

Best Wishes!

Lorenzo

@alcaeus
Copy link
Member

alcaeus commented Jul 19, 2017

This library will not be adapted to use the new driver. If you're looking for a replacement of this library, you can check out the MongoDB PHP library: https://github.com/mongodb/mongo-php-library.

We are in the process of adapting Doctrine MongoDB ODM to use the new library (and thus the new driver). You can track progress for this rewrite in doctrine/mongodb-odm#1553.

@alcaeus alcaeus closed this as completed Jul 19, 2017
@jmikola
Copy link
Member

jmikola commented Jul 19, 2017

Particularly the connection pooling of it is very interesting.

For the record, ext-mongodb does not provide any connection pooling (nor did ext-mongo before it):

For details on supported options, see » Connection String Options in the MongoDB manual. » Connection pool options are not supported, as the PHP driver does not implement connection pools.

That quote is taken from MongoDB\Driver\Manager::__construct(). The connection persistence model implemented by the extension is documented in the Connection Handling article. Please note the difference between connection pooling and persistence.

@lopezio
Copy link
Author

lopezio commented Jul 24, 2017

For the record, ext-mongodb does not provide any connection pooling (nor did ext-mongo before it):

Gosh, you're right. I must have been blinded by hope. The lack of connection pooling is one of the most annoying performance bottlenecks when using MongoDB with PHP. Using mongos even with mono-shard setups helps a bit (but also reduces redundancy, because the only way to mitigate it is to point to only one mongos), but is very far from being a solution. Let's hope pooling will find it's way to the new PHP extension.

Thanks a lot for pointing it out and redirecting me to the issue.

@jmikola
Copy link
Member

jmikola commented Jul 24, 2017

Let's hope pooling will find it's way to the new PHP extension.

The very idea of connection pooling conflicts with PHP's architecture for request handling. Note that this is a general problem for all database drivers (see: https://stackoverflow.com/q/39753/162228).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants