Comments (2)
I haven't implemented support for Neo4j clustering - that'll probably be a feature of the upcoming higher-level driver. If we assume a simple setup with 1 primary and several secondaries, and you want a way to get a connection pool to your primary server and then a list of connection pools for your read replicas, you could use the following approach, though it's probably not ideal:
- Connect to your primary server and create a pool using the approach in the deadpool-bolt example. You can use this pool for reads and writes.
- Grab a list of your read replicas by calling
route
on a connection from your primary pool. Use the list of IP addresses in the response to create a connection pool for each read replica, using the same approach as in step 1. - Distribute reads across your read replicas using whatever strategy you wish.
Note that I haven't tested this approach, and it doesn't account for things like multiple primaries or a routing table that changes over time - you'll have to handle those yourself if that's your use case. More details on clustering and the routing table here.
from bolt-rs.
Thanks for your detailed answer, I would try to implement it.
For example when I create the first pool and then get all the read replicas. I would store all these new pools in an Vec and the use something like a load balancer or round robin for each request.
I will be use a neo4j cluster o memgraph cluster
from bolt-rs.
Related Issues (18)
- Missing Version Bump? HOT 2
- Access Underlying value of each type HOT 2
- could not find `CommunicationError` in `error` HOT 1
- Example uses unavailable function compat HOT 4
- Appear Error "IO driver has terminated", How to solve HOT 1
- Serde Serialization/Deserialization HOT 2
- usage example HOT 4
- Hi! HOT 1
- Neo4j 4 support HOT 3
- Debug for Manager HOT 1
- QUESTION: how to connect to a different database HOT 1
- Production-readiness and contributions HOT 4
- GrapheneDB doesn't negotiate protocol version correctly HOT 2
- Question: Bolt v4 doc? HOT 2
- bolt-client v0.8.0 fails to build. bolt-proto v0.9.2 has incompatible with v0.9.1 change. HOT 2
- Iteration over a result set in bolt_client HOT 5
- Connect to a Neo4j Cluster HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolt-rs.