Hi guys, does the JS client library autodetect ALL...
# community-help
r
Hi guys, does the JS client library autodetect ALL nodes at runtime in the cluster and then load balance the requests on those new nodes as well? From the JS client library’s perspective, is there any difference if i provide only 1 node in the configuration or all nodes, given my cluster has 5 members?
k
The client does load balance requests and as well as quarantine bad nodes and periodically try to reintroduce them if they recover (if the user session is long enough to permit that).
r
ok, but does the JS client library autodetect ALL nodes at runtime in the cluster and then load balance the requests on those new nodes as well? From the JS client library’s perspective, is there any difference if i provide only 1 node in the configuration or all nodes, given my cluster has 5 members?
k
You've to pass an array of nodes like this: https://github.com/typesense/typesense-js/blob/master/doc/examples/browser/search.html#L27 I don't know what you mean by "new nodes" -- the client will use the nodes defined in the array during client initialisation. The client does not dynamically try to "discover" changes.