jbmusso / gremlin-javascript

JavaScript tools for graph processing in Node.js and the browser inspired by the Apache TinkerPop API
MIT License
214 stars 63 forks source link

Support for connecting to a graph cluster with multiple gremlin-servers #92

Open masumsoft opened 6 years ago

masumsoft commented 6 years ago

Currently the createClient api has a host parameter that seems to support only a single host at this moment. I couldn't find any way for the module to connect to multiple gremlin server hosts preferably with automatic node discovery and failover similar to other distributed system clients.

The go client for gremlin for example has cluster support. It would be great if this module had built in support for cluster load balancing, node discovery and failover.

jbmusso commented 6 years ago

I think we could add basic support for this, with a simple connection pool. This is something I've had on my mind for a while.

However, some distributed databases support complex client-side load balancing, ie. Cassandra (JanusGraph). The clients play a very important role and need to be aware of the cluster state (up/down nodes, latency, cluster topology, etc.). I don't think Gremlin server can stream that yet, and this is most likely outside of its scope anyway.