What is the proper way for connecting neo4j HA cluster using neo4j-ogm and allowing high availability and reads scale-out?
I have seen few solutions that involves haproxy.
the first one is the neo4j ogm-manual that shows how to configure haproxy to transfer connections to the current master. this solution allowing high availability, but disallowing scale-out reads.
The second one is Stefan Armbruster blog "neo4j and haproxy: some best practices and tricks" about configuring haproxy for routing reads operations for the whole cluster and write operations only for the master server.
I have few problems with Stefan solution:
- I cannot use bolt protocol, I must use http driver.
- I'm going to use transactions for all of my queries, and I'm afraid it will cause issues because according to the neo4j developer manual:
Open transactions are not shared among members of an HA cluster. Therefore, if you use this endpoint in an HA cluster, you must ensure that all requests for a given transaction are sent to the same Neo4j instance.