Calling Developers!
We are reenergizing our code contribution process! Learn More

Spryker + OpenSwoole or other PHP network frameworks

Options
j.sommer
j.sommer Spryker Solution Partner Posts: 2 🧑🏻‍🚀 - Cadet

Hi everyone,

Recently I tried out to implement the OpenSwoole framework in my local dev setup of the B2B demo shop.

OpenSwoole is a event-driven, asynchronous network framework with non-blocking I/O.

The big advantage you have with the framework (in addition to other features like coroutines) is that the rather costly spryker application boot process that gets executed on every request can be stored inside the OpenSwoole server workers. With that the application only needs to be booted once. However one of the disadvantages is that data persists between requests, for example in static arrays, which can lead to memory leaks.

I managed to create a proof of concept for the B2B demo shop. I needed to change the docker/sdk templates, implement a custom server worker and session storage and some more thing for it to work. The increase of the site loading speed I got was very high.

Although you properly need to refactor quite a bit of code, for example the static arrays used in the spryker code, It showed me that it is definitely possible to implement.

That's why I wanted to ask if the Spryker team looked into other network frameworks than PHP-FPM or if others have also tried or already managed to implement a stateful framework inside a Spryker project?

Tagged: