Bolt+routing and PHP

I am setting up a causal cluster for an app that uses the neo4j-php-client library from Graphaware, but it does not seem as though bolt+routing is supported as a protocol. So first question if is that is correct and if that means that I will need to implement routing myself?

If I need to implement routing myself then I was wondering if this basic architecture would be enough to at least get basic routing for a cluster setup without DNS discovery of instances.

  1. Store the addresses of each core server in a config file on the client.
  2. Try to connect to the first server in the list
    2a. If the server is down then proceed to the next server in the list
    2b. If the server is up then get the routing table using dbms.cluster.routing.getServers() and store READ and WRITE instances.
  3. Poll every X minutes to check if there are changes to the cluster topology (what is a good number for X here?)

When I then need to execute a query I will have to

  1. Detect whether it is a write or read query (regex for CREATE and MERGE?)
    1a. If it is a write query then send it to the WRITE instance
    1b. If it is a read query then send it to a randomly chosen READ instance
1 Like

are you using GitHub - graphaware/neo4j-bolt-php: PHP Driver for Neo4j's Binary Protocol : Bolt which is a PHP community driver supporting bolt.

Yep, that's the one I'm using. But I am not sure if it supports bolt+routing

Hi @SimonThordal, they not supporting bolt+routing on this moment. The same for Bookmark Casual Cluster.

It is nice if you can make a PR for that. cc @christophe

1 Like