Reputation: 127
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:
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.
Upvotes: 0
Views: 319
Reputation: 19373
At the moment, Neo4j OGM does not distinguish between reads and writes and hence is unable to decide whether to send a read request to a slave for example. This feature is on the roadmap, but for now, the safest is to direct all transactions to master.
Upvotes: 0