cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Bolt+routing and PHP

SimonThordal
Node Link

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 ACCEPTED SOLUTION

tomswinkels
Node Clone

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

View solution in original post

3 REPLIES 3

dana_canzano
Neo4j
Neo4j

are you using https://github.com/graphaware/neo4j-bolt-php 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

tomswinkels
Node Clone

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

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit - November 16 - 17, 2022.


Free NODES Training Series


October 19th -

Intro to Neo4j


October 20th -

Healthcare Analytics Using Neo4j


October 25th -

Handling Neo4j data with Apache Hop


October 26th -

Blazing Fast Graphs: Hands-on with Apache Arrow and Neo4j


November 2nd -

Graph EDA Using the Neo4j GDS Client