# Bolt+routing and PHP

**URL:** <https://community.neo4j.com/t/bolt-routing-and-php/9024>\
**Category:** PHP\
**Created:** [July 25, 2019, 11:08am UTC](https://community.neo4j.com/t/bolt-routing-and-php/9024 "2019-07-25T11:08:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonThordal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/simonthordal/32/335_2.png) [@SimonThordal](https://community.neo4j.com/u/SimonThordal)\
**Post date:** [July 25, 2019, 11:08am UTC](https://community.neo4j.com/t/bolt-routing-and-php/9024/1 "2019-07-25T11:08:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [July 25, 2019, 3:47pm UTC](https://community.neo4j.com/t/bolt-routing-and-php/9024/2 "2019-07-25T15:47:02Z")

</div>

are you using [GitHub - graphaware/neo4j-bolt-php: PHP Driver for Neo4j's Binary Protocol : Bolt](https://github.com/graphaware/neo4j-bolt-php) which is a PHP community driver supporting bolt.

---

<div class="post-metadata">

**Author:** ![SimonThordal](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/simonthordal/32/335_2.png) [@SimonThordal](https://community.neo4j.com/u/SimonThordal)\
**Post date:** [July 25, 2019, 4:14pm UTC](https://community.neo4j.com/t/bolt-routing-and-php/9024/3 "2019-07-25T16:14:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tomswinkels](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tomswinkels/32/148_2.png) [@tomswinkels](https://community.neo4j.com/u/tomswinkels)\
**Post date:** [August 29, 2019, 9:03am UTC](https://community.neo4j.com/t/bolt-routing-and-php/9024/4 "2019-08-29T09:03:40Z")

</div>

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
