MongoDB PHP drivers are not asynchronous ?? I am trying to rewrite a drop-in alternate with Rust! Help me understand the caveats!
I am working on ZealPHP, a coroutine native PHP runtime built on OpenSwoole, an OSS project, MIT, to swap the PHP execution model to make it asynchronous, have a legacy app CGI bridge that works like PHP-FPM with Apache Parity. The framework took shape with PHPStan Level 10, and you can see it here: https://php.zeal.ninja, a full stack framework that runs the HTTP server, WS server, does SSE, SSR, all the PHP you love and know. Still under development, but useable.
Github: https://github.com/sibidharan/zealphp
If you have the question Why ZealPHP? - https://php.zeal.ninja/why-zealphp
And if want to know the tradeoffs and design tax of ZealPHP - https://php.zeal.ninja/design-tradeoffs
So that the project makes sense in first place!!! It is a pure experiment, and if it works, it may help so many projects become async with minimal rewrite, thats the idea!
When I was at a point to move one of the big apps we use internally, I realised MongoDB PHP driver is the biggest blocker and it cant do Async!
So I am experimenting with this https://github.com/sibidharan/zealphp-mongodb (actively developing) to make MongoDB Asynchronous with Rust Drivers under the hood! The idea is: Bridges the official Rust MongoDB driver (mongo-rust-driver/tokio) into OpenSwoole's coroutine system. Drop-in replacement for mongodb/mongodb.
v0.1.0 is useable with full API parity with official mongodb PHP drivers!!
Now, help me understand if this is good, bad or worst? And what are the caveats I need to take into account?
I just want to make the PHP we all love Asynchronous keeping it FPM like (I did it almost I believe), and use MongoDB in it (still working on the rust port, adding more and more features comparing https://github.com/mongodb/mongo-php-driver ).
Or if there is an existing solution and I am pointlessly wasting time, guide me towards it!