Search code examples
phpneo4jcypherneoxygen

using neoxygen php neoclient without dependencies


How can we use neoclient without any framework .Because we are not using laravel or symphony even we are using nothing like these frameworks.Our backend is written pure core PHP. Simply my question is that if we are not using any framework for core purposes then why should we use them to just use a dbms .

When i calculated the size of vendor folder it was of 102 MB. So a single request will use up a large part of ram. Its my guess that while using Neo-client the all files contained in vendor folder will be loaded. so please correct me and if neoclient can be used separately I will be very happy to use that, but please must tell what will be the cons of using Neo-Client without dependencies.


Solution

  • I'm the creator and maintainer of NeoClient.

    To answer simply your questions about dependencies :

    1. It uses some Symfony dependencies to have a really flexible configuration management, offering possibilities to work in clusters without proxies, also the possibility to have built-in extensions.

    2. It doesn't mean it is tight to any framework.

    3. In development mode, the boostrapping of the client is not optimized for sure, there is in the README a detail of how you can optimize the client with a single flag during the setup. The performances are really really good, here the result of the benchmark :

    Benchmarking client instantation without cache, with result formatter enabled, 1000 runs Runned in 47.425533056259 seconds, using 8.5 mb memory

    Benchmarking client instatation with cache enabled, 1000 runs Runned in 0.068459987640381 seconds, using 8.5 mb memory

    NeoClient is used currently in more than 20 startups and enterprises which I'm aware of, and is now backed by GraphAware (the company I work for) for enterprise support.

    Also, I created a Bolt driver (binary protocol in neo4j 3.0) https://github.com/graphaware/neo4j-bolt-php which will be implemented in NeoClient (this will require a bit of work because multi-protocol was not something I thought when I created it)

    On the other side, the amount of dependencies does not mean it will instantiate all objects of all dependencies, Guzzle is used for its PSR-7 support and Curl abstraction, YAML is used if you provide config with YAML and all services are in lazy mode, meaning that all commands used internally will be really loaded into memory when called.