Git Product home page Git Product logo

Comments (2)

0xSiO avatar 0xSiO commented on May 23, 2024

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:

  1. 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.
  2. 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.
  3. 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.

ajosecueto avatar ajosecueto commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.