Next-generation MongoDB PHP Driver 0.3.1-alpha released

41 views
Skip to first unread message

Hannes Magnusson

unread,
Mar 26, 2015, 3:01:24 PM3/26/15
to mongodb-...@googlegroups.com
The PHP team is happy to announce that version 0.3.1-alpha of our new
"mongodb" PHP extension is now available on PECL[1].

The "mongodb" extension is an entirely new project, which is built
upon libbson[2] and libmongoc[3] (i.e. our C driver). This new
extension shares no code with our current, stable driver[4], which
will continue to be maintained for the foreseeable future.

This is our third alpha release and is the first to include Windows
compatibility. Initial documentation for the extension may be found on
PHP.net:
http://php.net/set.mongodb

This extension provides a low-level API for the most essential
functionality (e.g. queries, commands, write operations). Ultimately,
we expect developers to use this extension with a higher-level PHP
library, such as our mongo-php-library-prototype[5] project, which
provides a full-featured API (e.g. CRUD methods and convenience
methods for commands). For additional information about the
architecture behind our new drivers and library, please see this blog
post:
http://www.mongodb.com/blog/post/call-feedback-new-php-and-hhvm-drivers

Lastly, the extension also includes our first implementation of an
object-document serializer, which allows PHP objects (i.e. model
classes) to be persisted to MongoDB, and hydrated back into objects
after querying. An introduction to this feature can be found here:
http://10gen-labs.github.io/mongo-php-driver-prototype/ods/

To install the new extension:

$ pecl install mongodb-alpha
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded
Configuration" | sed -e "s|.*:\s*||"`

Windows binaries are available on PECL:
http://pecl.php.net/package/mongodb

As the "mongodb" extension is under heavy development, we would
appreciate any feedback you might have on the project:
https://jira.mongodb.org/secure/CreateIssue.jspa?pid=12484&issuetype=6

[1] http://pecl.php.net/package/mongodb
[2] https://github.com/mongodb/libbson
[3] https://github.com/mongodb/mongo-c-driver
[4] http://pecl.php.net/package/mongo
[5] https://github.com/10gen-labs/mongo-php-library-prototype

Hannes Magnusson

unread,
Apr 10, 2015, 6:04:13 PM4/10/15
to mongod...@googlegroups.com, mongodb-...@googlegroups.com, mongodb...@googlegroups.com
Working on the docs :)
They will be ready by the time we ship 1.0.0 :D

As for the performance difference.. Its difficult to measure since the api isn't identical.
We do try some tricks, like attempting to do non-blocking topology discovery of your cluster (so large ReplicaSet should work just fine), so there should be significant difference both in "initial connection" and the regular health check. We also try to avoid bson unserialization if the value isn't needed, and lots of minor tricks like that.

Depending on your application and usage though - any performance difference might be negligible.

-Hannes




On Friday, March 27, 2015 at 12:30:49 AM UTC-7, s.molinari wrote:
And to get adoption rolling better, I think complete documentation could help. (But, I understand how much of a chore it is...):-)

Scott
Reply all
Reply to author
Forward
0 new messages