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.
- Store the addresses of each core server in a config file on the client.
- 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 usingdbms.cluster.routing.getServers()
and storeREAD
andWRITE
instances. - 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
- Detect whether it is a write or read query (regex for
CREATE
andMERGE
?)
1a. If it is a write query then send it to theWRITE
instance
1b. If it is a read query then send it to a randomly chosenREAD
instance